www.pudn.com > controlsystem.ZIP > EX3020.M


% Example 3.20 
% 
wn=6; 
kosi=[0.1:0.1:1.0]; 
w=logspace(-1,1,100); 
figure(1) 
hold on 
num=[wn.^2]; 
%subplot(2,1,1); 
for kos=kosi 
  den=[1 2*kos*wn wn.^2]; 
  [mag,pha,w1]=bode(num,den,w); 
  subplot(2,1,1);hold on 
  semilogx(w1,mag); 
  subplot(2,1,2);hold on 
  semilogx(w1,pha); 
end 
subplot(2,1,1);grid on 
title('Bode Plot'); 
xlabel('Frequency (rad/sec)'); 
ylabel('Gain dB'); 
subplot(2,1,2);grid on 
xlabel('Frequency (rad/sec)'); 
ylabel('Phase deg'); 
hold off