Code covered by the BSD License  

Highlights from
MIMOtool

image thumbnail

MIMOtool

by

 

12 Nov 2001 (Updated )

Multi Input Multi Output Systems Toolbox

[a,b1,b2,c1,c2,d11,d12,d21,d22]=hpar(sys,r)
% [a,b1,b2,c1,c2,d11,d12,d21,d22]=hpar(P,r)
%
% unpacks the standard H-infinity plant
% similar to Pascal's hinf par to be used in mimotool only

function [a,b1,b2,c1,c2,d11,d12,d21,d22]=hpar(sys,r)

[rp,cp]=size(sys);
if nargin<2,
  error('usage: [a,b1,b2,c1,c2,d11,d12,d21,d22]=hpar(sys,r)');
elseif ~isinf(sys(rp,cp)),
  error('P is not a system in packed form');
end

na=sys(1,cp);
p2=r(1); m2=r(2);
p1=rp-(na+p2)-1; m1=cp-(na+m2)-1;
if m1<0 | p1<0,
  error('D11 has negative dimensions according to the dimensions R of D22');
end

[a,b1,c1,d11]=ltiss(sys);
b2=b1(:,m1+1:m1+m2);  b1=b1(:,1:m1);
c2=c1(p1+1:p1+p2,:); c1=c1(1:p1,:);
d12=d11(1:p1,m1+1:m1+m2);   d21=d11(p1+1:p1+p2,1:m1);
d22=d11(p1+1:p1+p2,m1+1:m1+m2);  d11=d11(1:p1,1:m1);

Contact us