This is a static copy of a profile reportHome
imread>parse_inputs (11550 calls, 2.574 sec)
Generated 05-Nov-2014 07:52:36 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/matlab/imagesci/imread.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
imread | function | 11550 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
504 | extraArgs = varargin(2:end); | 11361 | 0.360 s | 14.0% |  |
469 | fmt_s = struct([]); | 11550 | 0.310 s | 12.1% |  |
499 | if (~isempty(fmt_s)) | 11361 | 0.230 s | 8.9% |  |
495 | if (ischar(varargin{2})) | 11361 | 0.220 s | 8.6% |  |
492 | filename = varargin{1}; | 11361 | 0.150 s | 5.8% |  |
All other lines | | | 1.302 s | 50.6% |  |
Totals | | | 2.574 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 42 |
Non-code lines (comments, blank lines) | 18 |
Code lines (lines that can run) | 24 |
Code lines that did run | 17 |
Code lines that did not run | 7 |
Coverage (did run/can run) | 70.83 % |
Function listing
time calls line
466 function [filename, fmt_s, extraArgs, msg] = parse_inputs(varargin)
467
0.14 11550 468 filename = '';
0.31 11550 469 fmt_s = struct([]);
0.08 11550 470 extraArgs = {};
0.09 11550 471 msg = '';
472
473 % Parse arguments based on their number.
0.14 11550 474 switch(nargin)
0.08 11550 475 case 0
476
477 % Not allowed.
478 msg = 'Too few input arguments.';
479 return;
480
0.09 11550 481 case 1
482
483 % Filename only.
189 484 filename = varargin{1};
189 485 if ~ischar(filename)
486 error(message('MATLAB:imagesci:imread:badImageSourceDatatype'));
487 end
488
0.07 11361 489 otherwise
490
491 % Filename and format or other arguments.
0.15 11361 492 filename = varargin{1};
493
494 % Check whether second argument is a format.
0.22 11361 495 if (ischar(varargin{2}))
496 fmt_s = imformats(varargin{2});
497 end
498
0.23 11361 499 if (~isempty(fmt_s))
500 % The argument matches a format.
501 extraArgs = varargin(3:end);
0.06 11361 502 else
503 % The argument begins the format-specific parameters.
0.36 11361 504 extraArgs = varargin(2:end);
0.09 11361 505 end
506
0.05 11361 507 end