Error in code for MATlab
Ältere Kommentare anzeigen
clear all
syms s w
G = 1/((s)*(s+1)*(s+2)); %transfer function
G_w = subs(G,s,j*w);
W= [-1000:0.1:1000]; %[min_range:step size:max_range]
nyq = eval(subs(G_w,w,W));
x = real(nyq)
y = imag(nyq)
plot(x,y)
I can't seem to run this code and it keeps displaying error in line 100++ where I've only less than 20 lines.
This are the errors shown:
Error using symengine (line 59)
Division by zero.
Error in sym/subs>mupadsubs (line 139)
G = mupadmex('symobj::fullsubs',F.s,X2,Y2);
Error in sym/subs (line 124)
G = mupadsubs(F,X,Y);
Error in nyquist2 (line 8)
nyq = eval(subs(G_w,w,W)); %replace W with w in equation G_w
Does any expert know the cause of the problem?
2 Kommentare
Image Analyst
am 15 Jan. 2017
I've fixed the formatting for you this time, but for next time, please read this link to learn how to format.
Niam
am 15 Jan. 2017
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Spectral Measurements finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!