This is a static copy of a profile report

Home

images/private/morphop>ProcessOptionalArgs (14245 calls, 2.854 sec)
Generated 05-Nov-2014 07:52:49 using cpu time.
subfunction in file /usr1/opt/matlab/7.13/toolbox/images/images/private/morphop.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
images/private/morphop>ParseInputssubfunction14245
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
305
string = iptcheckstrs(varargin...
125241.071 s37.5%
303
for k = 1:length(varargin)
142450.280 s9.8%
324
iptcheckinput(unpacked_M, {'do...
121200.250 s8.8%
304
if ischar(varargin{k})
246440.230 s8.1%
321
end
246440.090 s3.2%
All other lines  0.931 s32.6%
Totals  2.854 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
iptcheckstrsfunction125240.901 s31.6%
iptcheckinputMEX-file121200.120 s4.2%
Self time (built-ins, overhead, etc.)  1.833 s64.2%
Totals  2.854 s100% 
Code Analyzer results
Line numberMessage
Coverage results
[ Show coverage for parent directory ]
Total lines in function35
Non-code lines (comments, blank lines)12
Code lines (lines that can run)23
Code lines that did run23
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
   time   calls  line
293 function [padopt,packopt,unpacked_M] = ProcessOptionalArgs(func_name, varargin)
294
295 % Default values
0.03 14245 296 padopt = 'same';
0.02 14245 297 packopt = 'notpacked';
14245 298 unpacked_M = -1;
0.04 14245 299 check_M = false;
300
0.07 14245 301 allowed_strings = {'same','full','ispacked','notpacked'};
302
0.28 14245 303 for k = 1:length(varargin)
0.23 24644 304 if ischar(varargin{k})
1.07 12524 305 string = iptcheckstrs(varargin{k}, allowed_strings, ...
306 func_name, 'OPTION', k+2);
0.06 12524 307 switch string
0.06 12524 308 case {'full','same'}
404 309 padopt = string;
310
0.06 12120 311 case {'ispacked','notpacked'}
0.07 12120 312 packopt = string;
313
0.05 12120 314 end
315
0.05 12120 316 else
0.06 12120 317 unpacked_M = varargin{k};
0.03 12120 318 check_M = true;
0.01 12120 319 M_pos = k+2;
0.06 12120 320 end
0.09 24644 321 end
322
0.04 14245 323 if check_M
0.25 12120 324 iptcheckinput(unpacked_M, {'double'},...
325 {'real' 'nonsparse' 'scalar' 'integer' 'nonnegative'}, ...
326 func_name, 'M', M_pos);
0.05 12120 327 end

Other subfunctions in this file are not included in this listing.