This is a static copy of a profile report

Home

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)

Function NameFunction TypeCalls
fminconfunction860
getIpOptionsfunction3440
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
16
fieldValue = optimget(options,...
43000.350 s68.1%
18
if strcmpi(fieldValue,allowedS...
34400.033 s6.4%
14
ME = []; % return empty MATLAB...
43000.033 s6.4%
25
end
34400.011 s2.1%
17
if ischar(fieldValue)
43000.011 s2.1%
All other lines  0.077 s14.9%
Totals  0.514 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
optimgetfunction43000.317 s61.7%
Self time (built-ins, overhead, etc.)  0.197 s38.3%
Totals  0.514 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function25
Non-code lines (comments, blank lines)15
Code lines (lines that can run)10
Code lines that did run6
Code lines that did not run4
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