This is a static copy of a profile reportHome
getNumericOrStringFieldValue (4300 calls, 0.514 sec)
Generated 05-Aug-2011 13:03:52 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/shared/optimlib/getNumericOrStringFieldValue.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
16 | fieldValue = optimget(options,... | 4300 | 0.350 s | 68.1% |  |
18 | if strcmpi(fieldValue,allowedS... | 3440 | 0.033 s | 6.4% |  |
14 | ME = []; % return empty MATLAB... | 4300 | 0.033 s | 6.4% |  |
25 | end | 3440 | 0.011 s | 2.1% |  |
17 | if ischar(fieldValue) | 4300 | 0.011 s | 2.1% |  |
All other lines | | | 0.077 s | 14.9% |  |
Totals | | | 0.514 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
optimget | function | 4300 | 0.317 s | 61.7% |  |
Self time (built-ins, overhead, etc.) | | | 0.197 s | 38.3% |  |
Totals | | | 0.514 s | 100% | |
Code Analyzer results
No Code Analyzer messages.Coverage results
[ Show coverage for parent directory ]
Total lines in function | 25 |
Non-code lines (comments, blank lines) | 15 |
Code lines (lines that can run) | 10 |
Code lines that did run | 6 |
Code lines that did not run | 4 |
Coverage (did run/can run) | 60.00 % |
Function listing
time calls line
1 function [fieldValue,ME] = getNumericOrStringFieldValue(fieldName, ...
2 allowedString,equivNumValue,dataTypeWithArticleForErrMsg,options,defaultopt)
3 %getNumericOrStringFieldValue reads in field value from options structure.
4 % This function processes option fields that can take either a numeric or
5 % a special string value.
6 % It reads in value of field fieldValue. If value is a string, it compares
7 % it to allowedString and converts it to equivalent numeric value. If
8 % string is not allowedString, it returns non-empty MATLAB exception
9 % object.
10 % Note: the input dataTypeWithArticleForErrMsg is the data type of the
11 % field along with its article for error printing purposes. E.g.
12 % 'an integer' or 'a real'.
13
0.03 4300 14 ME = []; % return empty MATLAB exception object unless error occurs
15 % Read in value of field
0.35 4300 16 fieldValue = optimget(options,fieldName,defaultopt,'fast');
0.01 4300 17 if ischar(fieldValue)
0.03 3440 18 if strcmpi(fieldValue,allowedString)
3440 19 fieldValue = equivNumValue;
20 else
21 errId = ['optim:getNumericOrStringFieldValue:Invalid' fieldName 'Option'];
22 ME = MException(errId,'Option %s must be %s value if not the default.', ...
23 fieldName,dataTypeWithArticleForErrMsg);
24 end
0.01 3440 25 end