how can I plot bode plot and phase magnitude plot of this code?
1 次查看(过去 30 天)
显示 更早的评论
close all; clear all; clc; w=[.001 .0036 .0126 .0464 .1668 .5995 2.1544 7.7426 27.8256 100 200]; for k=1:0.5:10; for a=1:0.5:5; num=k; den=[1 a 0]; sys=tf(num,den); end end for k0=1:1:171 figure(k0) [magk0,pha2k0,w]= bode(sysk0,w); end for k1 = 1:171 figure(k1) subplot(2,1,1) plot(w,20*log10(Magnitude(k1,:))) title('Magnitude (dB)') grid subplot(2,1,2) plot(w,Phase(k1,:)) title('Phase (°)') grid end
1 个评论
Michael Dombrowski
2017-7-12
What you need is a simple bode plot.
you can simply use:
w=[.001 .0036 .0126 .0464 .1668 .5995 2.1544 7.7426 27.8256 100 200];
for k=1:0.5:10
for a=1:0.5:5
num=k;
den=[1 a 0];
sys=tf(num,den);
end
end
bode(sys,w);
grid on
回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!