0001 function c = clim(handle,clims)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 switch(nargin),
0024 case 0,
0025
0026 c = get(gca,'CLim');
0027 case 1,
0028 if isdscalar(handle),
0029
0030 if ~ishandle(handle),
0031 error('Incorrect handle (type ''help <a href="matlab:help clim">clim</a>'' for details).');
0032 end
0033 c = get(handle,'CLim');
0034 else
0035
0036 clims = handle;
0037 if ~isdvector(clims,'<'),
0038 error('Incorrect color limits (type ''help <a href="matlab:help clim">clim</a>'' for details).');
0039 end
0040 set(gca,'CLim',clims);
0041 end
0042 case 2,
0043 if ~isdscalar(handle) || ~ishandle(handle),
0044 error('Incorrect handle (type ''help <a href="matlab:help clim">clim</a>'' for details).');
0045 end
0046 if ~isdvector(clims,'<'),
0047 error('Incorrect color limits (type ''help <a href="matlab:help clim">clim</a>'' for details).');
0048 end
0049
0050 c = clims;
0051 if strcmp(get(handle,'type'),'figure'),
0052
0053 children = get(handle,'children');
0054 for i = 1:length(children),
0055 child = children(i);
0056 if strcmp(get(child,'type'),'axes'),
0057 set(child,'CLim',clims);
0058 end
0059 end
0060 else
0061
0062 set(handle,'CLim',clims);
0063 end
0064 end
0065 end