%% Frequency of Peak Gain
% Identify which of the two resonances has higher gain 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]);
[gpeak,fpeak] = getPeakGain(sys)

% fpeak is the frequency corresponding to the peak gain gpeak. The peak at 1 rad/s is the overall peak gain of sys.
% Copyright 2012 The MathWorks, Inc.