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

  1. % function see(mat,iv_low,iv_high)
  2. %
  3. %   Display a specified range of a VARYING matrix or
  4. %   display state-space entries of a SYSTEM matrix
  5. %
  6. %   See also: DISP, FPRINTF, GETIV, PCK, RIFD, SEESYS, 
  7. %             SEEIV and SORTIV.
  8.  
  9. function see(mat,olow,ohigh)
  10.  if nargin == 0 | nargin == 2
  11.    disp('usage: see(mat)')
  12.    return
  13.  end
  14.  [mtype,mrows,mcols,mnum] = minfo(mat);
  15.  if mtype == 'vary'
  16.    if nargin == 3
  17.      [mat,err] = xtract(mat,olow,ohigh);
  18.      if err == -1
  19.        error('iv_high should be greater than iv_low')
  20.        return
  21.      elseif err == -2
  22.        error('no iv values in iv range')
  23.        return
  24.      end
  25.      [mtype,mrows,mcols,mnum] = minfo(mat);
  26.    end
  27.    [nr,nc] = size(mat);
  28.    place = 1;
  29.    omega = mat(1:mnum,nc);
  30.    if mrows > 1
  31.      if mcols > 1
  32.        fprintf('%.0f rows  %.0f columns\n',mrows,mcols)
  33.      else
  34.        fprintf('%.0f rows  %.0f column\n',mrows,mcols)
  35.      end
  36.    else
  37.      if mcols > 1
  38.        fprintf('%.0f row  %.0f columns\n',mrows,mcols)
  39.      else
  40.        fprintf('%.0f row  %.0f column\n',mrows,mcols)
  41.      end
  42.    end
  43.    fprintf('\n')
  44.    for i=1:mnum
  45. %    fprintf('indep variable  %g\n',omega(i))
  46.      fprintf('iv  =  %g\n',omega(i))
  47.      disp(mat(place:place+mrows-1,1:mcols))
  48.      place = place + mrows;
  49.    end
  50.  elseif mtype == 'syst'
  51.    clc
  52.    disp('A matrix')
  53.    disp(mat(1:mnum,1:mnum))
  54.    disp('strike any key to move to B matrix')
  55.    pause
  56.    clc
  57.    disp('B matrix')
  58.    disp(mat(1:mnum,mnum+1:mnum+mcols))
  59.    disp('strike any key to move to C matrix')
  60.    pause
  61.    clc
  62.    disp('C matrix')
  63.    disp(mat(mnum+1:mnum+mrows,1:mnum))
  64.    disp('strike any key to move to D matrix')
  65.    pause
  66.    clc
  67.    disp('D matrix')
  68.    disp(mat(mnum+1:mnum+mrows,mnum+1:mnum+mcols))
  69.  else
  70.    disp(mat)
  71. end
  72. %
  73. % Copyright MUSYN INC 1991,  All Rights Reserved
  74.