This is a static copy of a profile reportHome
imrotate>parse_inputs (1721 calls, 1.352 sec)
Generated 05-Nov-2014 07:52:57 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/imrotate.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
imrotate | function | 1721 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
241 | idx = strmatch(lower(method),s... | 1721 | 0.551 s | 40.7% |  |
252 | idx = strmatch(lower(bbox),str... | 1721 | 0.521 s | 38.5% |  |
239 | if ischar(method) && i... | 1721 | 0.040 s | 3.0% |  |
244 | elseif length(idx)>1, | 1721 | 0.030 s | 2.2% |  |
257 | else | 1721 | 0.020 s | 1.5% |  |
All other lines | | | 0.190 s | 14.1% |  |
Totals | | | 1.352 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
cell.strmatch | function | 3442 | 1.031 s | 76.3% |  |
Self time (built-ins, overhead, etc.) | | | 0.320 s | 23.7% |  |
Totals | | | 1.352 s | 100% | |
Code Analyzer results
Line number | Message |
241 | STRMATCH will be removed in a future release. Use STRNCMP instead. |
252 | STRMATCH will be removed in a future release. Use STRNCMP instead. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 53 |
Non-code lines (comments, blank lines) | 10 |
Code lines (lines that can run) | 43 |
Code lines that did run | 26 |
Code lines that did not run | 17 |
Coverage (did run/can run) | 60.47 % |
Function listing
time calls line
210 function [A,ang,method,bbox] = parse_inputs(varargin)
211 % Outputs: A the input image
212 % ang the angle by which to rotate the input image
213 % method interpolation method (nearest,bilinear,bicubic)
214 % bbox bounding box option 'loose' or 'crop'
215
216 % Defaults:
1721 217 method = 'n';
1721 218 bbox = 'l';
219
0.01 1721 220 error(nargchk(2,4,nargin,'struct'));
1721 221 switch nargin
0.01 1721 222 case 2, % imrotate(A,ang)
223 A = varargin{1};
224 ang=varargin{2};
0.02 1721 225 case 3, % imrotate(A,ang,method) or
0.02 1721 226 A = varargin{1}; % imrotate(A,ang,box)
1721 227 ang=varargin{2};
0.01 1721 228 method=varargin{3};
229 case 4, % imrotate(A,ang,method,box)
230 A = varargin{1};
231 ang=varargin{2};
232 method=varargin{3};
233 bbox=varargin{4};
234 otherwise,
235 error(message('images:imrotate:invalidInputs'))
236 end
237
238 % Check validity of the input parameters
0.04 1721 239 if ischar(method) && ischar(bbox),
0.02 1721 240 strings = {'nearest','bilinear','bicubic','crop','loose'};
0.55 1721 241 idx = strmatch(lower(method),strings);
0.01 1721 242 if isempty(idx),
243 error(message('images:imrotate:unrecognizedInterpolationMethod', method))
0.03 1721 244 elseif length(idx)>1,
245 error(message('images:imrotate:ambiguousInterpolationMethod', method))
1721 246 else
0.01 1721 247 if idx==4,bbox=strings{4};method=strings{1};
0.02 1721 248 elseif idx==5,bbox = strings{5};method=strings{1};
1721 249 else method = strings{idx};
1721 250 end
1721 251 end
0.52 1721 252 idx = strmatch(lower(bbox),strings(4:5));
0.01 1721 253 if isempty(idx),
254 error(message('images:imrotate:unrecognizedBBox', bbox))
1721 255 elseif length(idx)>1,
256 error(message('images:imrotate:ambiguousBBox', bbox))
0.02 1721 257 else
0.01 1721 258 bbox = strings{3+idx};
1721 259 end
260 else
261 error(message('images:imrotate:expectedString'))
262 end