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

  1. function J = jet(m)
  2. %JET    Variant of HSV.
  3. %    JET(M), a variant of HSV(M), is the colormap used with the
  4. %    NCSA fluid jet image.
  5. %    JET, by itself, is the same length as the current colormap.
  6. %    Use COLORMAP(JET).
  7. %
  8. %    See also HSV, HOT, PINK, FLAG, COLORMAP, RGBPLOT.
  9.  
  10. %    C. B. Moler, 5-10-91, 8-19-92.
  11. %    Copyright (c) 1984-93 by The MathWorks, Inc.
  12.  
  13. if nargin < 1, m = size(get(gcf,'colormap'),1); end
  14. n = max(round(m/4),1);
  15. x = (1:n)'/n;
  16. y = (n/2:n)'/n;
  17. e = ones(length(x),1);
  18. r = [0*y; 0*e; x; e; flipud(y)];
  19. g = [0*y; x; e; flipud(x); 0*y];
  20. b = [y; e; flipud(x); 0*e; 0*y];
  21. J = [r g b];
  22. while size(J,1) > m
  23.    J(1,:) = [];
  24.    if size(J,1) > m, J(size(J,1),:) = []; end
  25. end
  26.