%% Peak Gain Within Specified Band
% Compute the peak gain of the higher-frequency resonance in the transfer function
% sys = \left( {{1 \over {{s^2} + 0.2s + 1}}} \right)\left( {{{100} \over {{s^2} + s + 100}}} \right).
% sys is the product of resonances at 1 rad/s and 10 rad/s.

sys = tf(1,[1,.2,1])*tf(100,[1,1,100]);
fband = [8,12];
gpeak = getPeakGain(sys,0.01,fband);

% The fband argument causes getPeakGain to return the local peak gain between 8 and 12 rad/s.
% Copyright 2012 The MathWorks, Inc.