%% Multi Input, Multi Output (MIMO) Loop Sensitivities
% Consider an integral controller for a constant-gain, 2-input, 2-output plant. For purposes of illustration, the controller is designed via inversion, with different bandwidths in each rotated channel.

P = ss([2 3;-1 1]); 
BW = diag([2 5]); 
[U,S,V] = svd(P.d);                % get SVD of Plant Gain 
Csvd = V*inv(S)*BW*tf(1,[1 0])*U'; % inversion based on SVD 
loops = loopsens(P,Csvd); 
bode(loops.So,'g',loops.To,'r.',logspace(-1,3,120))
title('Output Sensitivity (green), Output Complementary Sensitivity (red)');

%
% Copyright 2015 The MathWorks, Inc.