Getting Subscripted assignment dimension mismatch. !!! Help Please
显示 更早的评论
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 个评论
Birdman
2017-10-25
Can you also share the function Optimal_C_Given_n_NE ?
ibrahim alturki
2017-10-25
ibrahim alturki
2017-10-25
Birdman
2017-10-25
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
2017-10-25
Calculations between symbolic and numeric is not necessarily a problem.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Scatter Plots 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



