Undefined function 'symsum' for input arguments of type 'double'.
이전 댓글 표시
Hi, I am getting the error
Undefined function 'symsum' for input arguments of type 'double'.
Error in LoopsumQ2 (line 40)
T=symsum(Q,k,1,200)
I do not understand what this means as I am trying to sum this objective function.
The values of l,q,s,pk(k),y(k),z(k) are all computed already before this for loop takes place.
Is there something wron in my code?
syms k
for k=1:1:200;
Q=pk(k)*((l-q).'*z(k)-s.'*y(k));
T=symsum(Q,k,1,200)
end
댓글 수: 7
madhan ravi
2019년 5월 8일
편집: madhan ravi
2019년 5월 8일
T=cell(200,1);
syms kk
for k=1:200;
Q=pk(k)*((l-q).'*z(k)- s.'*y(k));
T{k}=symsum(Q,kk,1,200)
end
bus14
2019년 5월 8일
Walter Roberson
2019년 5월 8일
Which variable is symbolic? symsum() is only for symbolic expressions.
bus14
2019년 5월 8일
Walter Roberson
2019년 5월 8일
What size are l, q, s?
Walter Roberson
2019년 5월 8일
If those are constant then the .' operators have no reason to be there so I have to assume that they are vector or 2D array in the real problem. The solution if they are constant is very simple but with them being multivalued I need to think carefully about putting the expression together.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Calculus에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!