%% Header
% Purpose:  Calculating M_s-value from controller tuning
% Author:   Axel Lødemel Holene 
% E-mail:   axel.holene@gmail.com
% Date:     13. February 2013
% About:    

function Ms = distMs(C, G)
    Ms = max(abs(freqresp(1/(1 + G.tf*C.tf),...
         logspace(-4,4,40000)))) ;
end