www.gusucode.com > control 案例程序 matlab源码代码 > control/ConstrainWeightedGainOfClosedLoopSystemExample.m

    %% Constrain Weighted Gain of Closed-Loop System  
% Create a tuning goal requirement that constrains the gain of a closed-loop
% SISO system from its input, _r_, to its output, _y_. Weight the gain at
% its input by a factor of 10 and at its output by the frequency-dependent
% weight $1/(s + 0.01)$.   

%%  
WL = tf(1,[1 0.01]);
WR = 10;
Req = TuningGoal.WeightedGain('r','y',WL,WR);  

%% 
% You can use the requirement |Req| with |systune| to tune the free parameters
% of any control system model that has an input signal named |'r'| and an
% output signal named |'y'|. 
%
% You can then use |viewSpec| to validate the tuned control system against
% the requirement.