home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l455 / 2.ddi / MUTOOLS1.DI$ / PSS2SYS.M < prev    next >
Encoding:
Text File  |  1993-03-11  |  681 b   |  24 lines

  1. % function sys = pss2sys(mat,n)
  2. %
  3. %   Converts a CONSTANT matrix into a SYSTEM matrix with n
  4. %   states. assumes that the constant matrix has the state
  5. %   space data in the form  mat = [A B;C D], and that the
  6. %   matrix A is n x n.
  7. %
  8. %   See also: MINFO, PCK, ND2SYS, SYS2PSS, UNPCK, and ZP2SYS.
  9.  
  10. function sys = pss2sys(mat,n)
  11.  if nargin ~= 2
  12.    disp('usage: sys = pss2sys(mat,n)');
  13.    return
  14.  end
  15.  [nr,nc] = size(mat);
  16.  if n < min([nr nc])
  17.    sys = pck(mat(1:n,1:n),mat(1:n,n+1:nc),mat(n+1:nr,1:n),mat(n+1:nr,n+1:nc));
  18.  else
  19.    error('insufficient rows/columns for given number of states')
  20.    return
  21.  end
  22. %
  23. % Copyright MUSYN INC 1991,  All Rights Reserved
  24.