home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l460 / 2.ddi / COLOR.DI$ / GRAY.M < prev    next >
Encoding:
Text File  |  1993-03-07  |  512 b   |  18 lines

  1. function g = gray(m)
  2. %GRAY    Linear gray-scale color map.
  3. %    GRAY(M) returns an M-by-3 matrix containing a gray-scale colormap.
  4. %    GRAY, by itself, is the same length as the current colormap.
  5. %
  6. %    For example, to reset the colormap of the current figure:
  7. %
  8. %              colormap(gray)
  9. %
  10. %    See also HSV, HOT, COOL, BONE, COPPER, PINK, FLAG, 
  11. %    COLORMAP, RGBPLOT.
  12.  
  13. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  14.  
  15. if nargin < 1, m = size(get(gcf,'colormap'),1); end
  16. g = (0:m-1)'/max(m-1,1);
  17. g = [g g g];
  18.