This is a static copy of a profile reportHome
imhist>parse_inputs (404 calls, 0.160 sec)
Generated 05-Nov-2014 07:52:42 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/imhist.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
imhist | function | 404 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
275 | iptchecknargin(1,2,nargin,mfil... | 404 | 0.070 s | 43.8% |  |
299 | isScaled = 1; | 404 | 0.020 s | 12.5% |  |
292 | case 'logical' | 404 | 0.020 s | 12.5% |  |
316 | iptcheckinput(n, {'numeric'}, ... | 404 | 0.010 s | 6.2% |  |
313 | if (numel(varargin{2}) == 1) | 404 | 0.010 s | 6.2% |  |
All other lines | | | 0.030 s | 18.7% |  |
Totals | | | 0.160 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
iptchecknargin | function | 404 | 0.020 s | 12.5% |  |
iptcheckinput | MEX-file | 808 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.140 s | 87.5% |  |
Totals | | | 0.160 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 61 |
Non-code lines (comments, blank lines) | 17 |
Code lines (lines that can run) | 44 |
Code lines that did run | 17 |
Code lines that did not run | 27 |
Coverage (did run/can run) | 38.64 % |
Function listing
time calls line
273 function [a, n, isScaled, top, map] = parse_inputs(varargin)
274
0.07 404 275 iptchecknargin(1,2,nargin,mfilename);
404 276 a = varargin{1};
404 277 iptcheckinput(a, {'double','uint8','int8','logical','uint16','int16','single','uint32', 'int32'}, ...
278 {'2d','nonsparse'}, mfilename, ['I or ' 'X'], 1);
404 279 n = 256;
280
404 281 switch (class(a))
404 282 case {'double', 'single'}
283 isScaled = 1;
284 top = 1;
285 map = [];
286
0.01 404 287 case {'uint8', 'int8'}
288 isScaled = 1;
289 top = 255;
290 map = [];
291
0.02 404 292 case 'logical'
293 n = 2;
294 isScaled = 1;
295 top = 1;
296 map = [];
297
404 298 case {'int16', 'uint16'}
0.02 404 299 isScaled = 1;
404 300 top = 65535;
404 301 map = [];
302
303 case {'int32', 'uint32'}
304 isScaled = 1;
305 top = double(intmax('uint32'));
306 map = [];
307
308 otherwise
309 % shouldn't happen.
310 end
311
0.01 404 312 if (nargin ==2)
0.01 404 313 if (numel(varargin{2}) == 1)
314 % IMHIST(I, N)
404 315 n = varargin{2};
0.01 404 316 iptcheckinput(n, {'numeric'}, {'real','positive','integer'}, mfilename, ...
317 'N', 2);
318
319 elseif (size(varargin{2},2) == 3)
320 if isa(a,'int16')
321 error(message('images:imhist:invalidIndexedImage'))
322 end
323
324 % IMHIST(X,MAP) or invalid second argument
325 n = size(varargin{2},1);
326 isScaled = 0;
327 top = n;
328 map = varargin{2};
329
330 else
331 error(message('images:imhist:invalidSecondArgument'))
332 end
404 333 end