Getting Subscripted assignment dimension mismatch. !!! Help Please
Show older comments
Hello, so my code look like this
Code Start:
%Parameters
ci = 2;
ca = 40;
cr = 1.9;
n_pre = 60;
x_pre = 3;
N = 100;
syms x ;
%Parameter to be optimized
n = 1:N ;
for i = 1 : length(n)
c = Optimal_C_Given_n_NE (ci,ca,cr,n(i),n_pre,x_pre);
%E[TC]
ETC(i) = symsum( PMF_x_n(n(i),x,n_pre,x_pre)*(ci*N+cr*(EV_U_Given_X(x,N,n(i),n_pre,x_pre)+x)),x,0,c) +...
symsum( PMF_x_n(n(i),x,n_pre,x_pre)*(ci*n+cr*x+ca*EV_U_Given_X(x,N,n(i),n_pre,x_pre)),x,0,c);
end
% code end
and i am getting this error:
"
Subscripted assignment dimension mismatch.
Error in sym/privsubsasgn (line 1107)
L_tilde2 = builtin('subsasgn',L_tilde,struct('type','()','subs',{varargin}),R_tilde);
Error in sym/subsasgn (line 944)
C = privsubsasgn(L,R,inds{:});
Error in Output (line 18)
ETC(i) = symsum( PMF_x_n(n(i),x,n_pre,x_pre)*(ci*N+cr*(EV_U_Given_X(x,N,n(i),n_pre,x_pre)+x)),x,0,c) +... "
5 Comments
Birdman
on 25 Oct 2017
Can you also share the function Optimal_C_Given_n_NE ?
ibrahim alturki
on 25 Oct 2017
ibrahim alturki
on 25 Oct 2017
Birdman
on 25 Oct 2017
There is a problem in the PMF_x_n function. You try to make calculations between different variables where x is a symbolic variable and the rest of the inputs are numeric variables double type. Consider this.
Walter Roberson
on 25 Oct 2017
Calculations between symbolic and numeric is not necessarily a problem.
Accepted Answer
More Answers (0)
Categories
Find more on Scatter Plots in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


