Error in code for MATlab
Mostra commenti meno recenti
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 Commenti
Image Analyst
il 15 Gen 2017
I've fixed the formatting for you this time, but for next time, please read this link to learn how to format.
Niam
il 15 Gen 2017
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spectral Measurements in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!