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

1 visualización (últimos 30 días)
nelson
nelson el 12 de Jul. de 2017
Comentada: Michael Dombrowski el 12 de Jul. de 2017
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 comentario
Michael Dombrowski
Michael Dombrowski el 12 de Jul. de 2017
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

Iniciar sesión para comentar.

Respuestas (0)

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by