clear all
syms s w
G = 1/((s)*(s+1)*(s+2)); %transfer function
G_w = subs(G,s,j*w);
W= [-100:0.01:100]; %[min_range:step size:max_range]
nyq = eval(subs(G_w,w,W));
x = real(nyq)
y = imag(nyq)
plot(x,y)
我似乎无法运行此代码,并且它一直在第 100++ 行显示错误,而我只有不到 20 行。
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
这是显示的错误,任何专家都可以帮助我吗?