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!