《matlab绘制系统函数波特图》由会员分享,可在线阅读,更多相关《matlab绘制系统函数波特图(3页珍藏版)》请在金锄头文库上搜索。
1、已知系统函数:H(s)=30/(s2+31s+30),先画出幅频特性和相频特性view plaincopy to clipboardprint?1.w=-8*pi:0.01:8*pi; 2.b=30; 3.a=1,31,30; 4.H=freqs(b,a,w); 5.subplot(211) 6.plot(w,abs(H);grid on 7.xlabel(/omega(rad/s),ylabel(|H(/omega)|); 8.title(H(s)的幅频特性) 9.subplot(212) 10. plot(w,angle(H);grid on 11. xlabel(/omega(rad/s
2、),ylabel(/phi(/omega); 12. title(H(s)的相频特性) w=-8*pi:0.01:8*pi;b=30;a=1,31,30;H=freqs(b,a,w);subplot(211)plot(w,abs(H);grid onxlabel(/omega(rad/s),ylabel(|H(/omega)|);title(H(s)幅 幅 幅 幅 幅 )subplot(212)plot(w,angle(H);grid onxlabel(/omega(rad/s),ylabel(/phi(/omega);title(H(s)幅 幅 幅 幅 幅 ) 然后再画出波特图view plaincopy to clipboardprint?1.figure 2.sys=tf(b,a); 3.bode(sys);grid on figuresys=tf(b,a);bode(sys);grid on