%% Unity Gain Crossover
% Find the 0dB crossover frequencies of a single-loop control system with plant given by:
% G\left( s \right) = {1 \over {{{\left( {s + 1} \right)}^3}}},
% and PI controller given by:
% C\left( s \right) = 1.14 + {{0.454} \over s}.

G = zpk([],[-1,-1,-1],1);
C = pid(1.14,0.454);
sys = G*C;
wc = getGainCrossover(sys,1)

% The 0 dB crossover frequencies are the frequencies at which the open-loop response sys = G*C has unity gain. Because this system only crosses unity gain once, getGainCrossover returns a single value.
% Copyright 2012 The MathWorks, Inc.