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!



