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

  1. % function mat = sys2pss(sys)
  2. %
  3. %   Unpacks a SYSTEM matrix into a packed matrix,
  4. %    MAT = [A B; C D];
  5. %
  6. %   See also: PCK, PSS2SYS, UNPCK, VPCK and VUNPCK.
  7.  
  8. function [mat] = sys2pss(sys)
  9.   if nargin ~= 1
  10.     disp('usage: mat = sys2pss(sys)')
  11.     return
  12.   end
  13.   [systype,sysr,sysc,sysn] = minfo(sys);
  14.   if systype == 'syst'
  15.     [nr nc] = size(sys);
  16.     nr = nr-1;
  17.     nc = nc-1;
  18.     mat = sys(1:nr,1:nc);
  19.   elseif systype == 'cons'
  20.     mat = sys;
  21.   elseif systype == 'vary'
  22.     error(['can''t unpack a VARYING matrix']);
  23.     return
  24.   else
  25.     mat = [];
  26.   end
  27. %
  28. % Copyright MUSYN INC 1991,  All Rights Reserved
  29.