0001 function h = uimagesc(varargin)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 clim = [];
0018 switch (nargin),
0019 case 0,
0020 hh = uimage('CDataMapping','scaled');
0021 case 1,
0022 hh = uimage(varargin{1},'CDataMapping','scaled');
0023 case 3,
0024 hh = uimage(varargin{:},'CDataMapping','scaled');
0025 otherwise,
0026
0027
0028 if isequal(size(varargin{end}),[1 2])
0029 str = false(length(varargin),1);
0030 for n=1:length(varargin)
0031 str(n) = ischar(varargin{n});
0032 end
0033 str = find(str);
0034 if isempty(str) || (rem(length(varargin)-min(str),2)==0),
0035 clim = varargin{end};
0036 varargin(end) = [];
0037 else
0038 clim = [];
0039 end
0040 else
0041 clim = [];
0042 end
0043 hh = uimage(varargin{:},'CDataMapping','scaled');
0044 end
0045
0046
0047 cax = ancestor(hh,'axes');
0048
0049 if ~isempty(clim),
0050 set(cax,'CLim',clim)
0051 elseif ~ishold(cax),
0052 set(cax,'CLimMode','auto')
0053 end
0054
0055 if nargout > 0
0056 h = hh;
0057 end