how can I plot bode plot and phase magnitude plot of this code?

1 回表示 (過去 30 日間)
nelson
nelson 2017 年 7 月 12 日
コメント済み: Michael Dombrowski 2017 年 7 月 12 日
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
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!

Translated by