home *** CD-ROM | disk | FTP | other *** search
- function h = imagesc(x,y,a)
- %IMAGESC Scale data and display as image.
- % IMAGESC(...) is the same as IMAGE(...) except the data is scaled
- % to use the full colormap.
- % See also IMAGE.
-
- % Copyright (c) 1984-93 by The MathWorks, Inc.
-
- m = size(colormap,1);
- if nargin == 1
- a = x;
- end
- amin = min(min(a));
- amax = max(max(a));
- idx = min(m,round((m-1)*(a-amin)/(amax-amin))+1);
- if nargin == 1
- hh = image(idx);
- else
- hh = image(x,y,idx);
- end
- set(hh,'UserData',[amin amax]);
- if nargout > 0
- h = hh;
- end
-