www.gusucode.com > robust 案例源码程序 matlab代码 > robust/PlotMultipleFrequencyResponsesExample.m

    %% Plot Multiple Frequency Responses
% Create two SISO second-order systems, and calculate their frequency responses
% over different frequency ranges.
%%

% Copyright 2015 The MathWorks, Inc.

a1 = [-1,1;-1,-0.5];
b1 = [0;2]; c1 = [1,0]; d1 = 0; 
sys1 = ss(a1,b1,c1,d1); 
a2 = [-.1,1;-1,-0.05]; 
b2 = [1;1]; c2 = [-0.5,0]; d2 = 0.1; 
sys2 = ss(a2,b2,c2,d2); 
omega = logspace(-2,2,100); 
sys1g = frd(sys1,omega); 
omega2 = [ [0.05:0.1:1.5] [1.6:.5:20] [0.9:0.01:1.1] ]; 
omega2 = sort(omega2); 
sys2g = frd(sys2,omega2);
%%
% Create an |frd| object with a single frequency. 
sys3 = rss(1,1,1);
rspot = frd(sys3,2); 
%%
% The following plot uses the |plot_type| specification |'liv,lm'|.
uplot('liv,lm',sys1g,'b-.',rspot,'r*-',sys2g);
xlabel('log independent variable') 
ylabel('log magnitude') 
title('axis specification: liv,lm')
%%