%% Continuous-Time Weighting Functions
% Create continuous-time weighting functions by specifying the low-frequency gain, high-frequency gain, and magnitude of the gain at some intermediate frequency.
% For instance, create a weighting function with a gain of 40 dB at low frequency, rolling off to –20 dB at high frequency. Specify further that the gain is about 10 dB at 1 rad/s by putting these values in a vector [freq,mag]. Specify all the gains in absolute units.

Wl = makeweight(100,[1,3.16],0.1);

%
% Create a weighting function with a gain of –10 dB at low frequency, rising to 40 dB at high frequency. Specify a 0 dB crossover frequency of 10 rad/s. To specify a 0 dB crossover frequency, you can use the crossover frequency as the second input argument instead of the vector [freq,mag].

Wh = makeweight(0.316,10,100);

%
% Plot the magnitudes of the weighting functions to confirm that they meet the response specifications.

bodemag(Wl,Wh)
legend
grid on

%
% Copyright 2015 The MathWorks, Inc.