Subs does not do the job
이전 댓글 표시
Hello friends!
I do not understand why in my code (see bellow) the command 'subs' does not through ant error and at the same time does
not do anything. I did google it but unfrtunately was not able to figure out what is the root of the problem.
clc;
J=3;
EZh=sym('EZh',[J 1]);
e=sym('e',[J 1]);
syms z w
for j=1:J
A=expand((z-w)^j);
A=char(A);
A=replace(A,'w','e(1)');
for k=j:-1:2
A=replace(A,strcat(['z^',num2str(k)]),strcat(['e(',num2str(k),')']));
end
A=replace(A,'z','e(1)');
A=append('rho^',num2str(j),'*(',A,')');
EZh(j)=str2sym(A);
end
EZh
EZh=subs(EZh,e,{1;1;1});
EZh
Any help is greatly appreciated!
Babak
댓글 수: 2
Torsten
2022년 1월 24일
Don't you have to use [ ] instead of { } in the subs command ?
Mohammad Shojaei Arani
2022년 1월 24일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Share and Distribute Software에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


