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!



