This is a static copy of a profile reportHome
optimget>optimgetfast (41360 calls, 1.683 sec)
Generated 05-Aug-2011 13:03:51 using cpu time.
subfunction in file /usr/local/MATLAB/R2011a/toolbox/matlab/funfun/optimget.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Function Name | Function Type | Calls |
optimget | function | 41360 |
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
103 | value = options.(name); | 41280 | 0.372 s | 22.1% |  |
108 | if isempty(value) | 41280 | 0.328 s | 19.5% |  |
94 | if isempty(options) | 41360 | 0.306 s | 18.2% |  |
109 | value = defaultopt.(name); | 34400 | 0.175 s | 10.4% |  |
102 | try | 41280 | 0.164 s | 9.7% |  |
All other lines | | | 0.339 s | 20.1% |  |
Totals | | | 1.683 s | 100% | |
Children (called functions)
No childrenCode Analyzer results
Line number | Message |
104 | The value assigned to variable 'ME' might be unused. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 26 |
Non-code lines (comments, blank lines) | 14 |
Code lines (lines that can run) | 12 |
Code lines that did run | 8 |
Code lines that did not run | 4 |
Coverage (did run/can run) | 66.67 % |
Function listing
time calls line
85 function value = optimgetfast(options,name,defaultopt)
86 %OPTIMGETFAST Get OPTIM OPTIONS parameter with no error checking so fast.
87 % VAL = OPTIMGETFAST(OPTIONS,FIELDNAME,DEFAULTOPTIONS) will get the
88 % value of the FIELDNAME from OPTIONS with no error checking or
89 % fieldname completion. If the value is [], it gets the value of the
90 % FIELDNAME from DEFAULTOPTIONS, another OPTIONS structure which is
91 % probably a subset of the options in OPTIONS.
92 %
93
0.31 41360 94 if isempty(options)
0.01 80 95 value = defaultopt.(name);
80 96 return;
97 end
98 % We need to know if name is a valid field of options, but it is faster to use
99 % a try-catch than to test if the field exists and if the field name is
100 % correct. If the options structure is from an older version of the
101 % toolbox, it could be missing a newer field.
0.16 41280 102 try
0.37 41280 103 value = options.(name);
104 catch ME
105 value = [];
106 end
107
0.33 41280 108 if isempty(value)
0.17 34400 109 value = defaultopt.(name);
0.10 34400 110 end
Other subfunctions in this file are not included in this listing.