symbolic calculation - subs does not work after diff
Ältere Kommentare anzeigen
In the following code I create a symbolc expression. I want to differentiate it and after that I want to evaluate it at specific datapoints. The evaluation works before the diff command but not afterwards. In other examples this works well but not in the one shown below. Any ideas?
syms x
A=1;
B=2;
D=1;
C=3;
E=A+(B*C^2)./(B^2-x.^2-1i.*C.*x);
n=sqrt((sqrt(real(E).^2+imag(E).^2)+real(E))./2);
y=10:1:300;
nN=subs(n,x,y);
plot(y,nN)
dn=diff(n);
dnN=subs(dn,x,y)
plot(y,dnN)
Thanks, Dirk
Antworten (1)
Andrei Bobrov
am 19 Okt. 2011
syms x real
A=1;
B=2;
D=1;
C=3;
E=A+(B*C^2)./(B^2-x.^2-1i.*C.*x);
n=sqrt((sqrt(real(E).^2+imag(E).^2)+real(E))./2);
y=10:1:300;
nN=subs(n,x,y);
plot(y,nN)
dn=diff(n);
dnN=subs(dn,x,y)
plot(y,dnN)
Kategorien
Mehr zu Symbolic Math Toolbox finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!