home *** CD-ROM | disk | FTP | other *** search
/ Borland Programmer's Resource / Borland_Programmers_Resource_CD_1995.iso / utils / mathstud / fliplr.m < prev    next >
Encoding:
Text File  |  1995-05-19  |  366 b   |  19 lines

  1. function y = fliplr(x,nc)
  2. % y = fliplr(x,nc)
  3. % fliplr(x)        reverse the order of the argument columns
  4. % fliplr(x,nc)    reverse the order of the first nc columns
  5.  
  6. %       S.Halevy 7/31/92
  7. %       Copyright (c) 1992 by the MathWizards
  8.  
  9. y=x;
  10. [m,n] = size(y);
  11.  
  12. if nargin<2
  13.    nc=n;
  14. else
  15.    nc = abs(nc);
  16. end
  17. nc=expr_sel(nc>n,n,nc);
  18. y(:,nc:-1:1)=x(:,1:nc);
  19.