This is a static copy of a profile reportHome
optimget (41360 calls, 2.896 sec)
Generated 05-Aug-2011 13:03:51 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/funfun/optimget.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 |
25 | o = optimgetfast(options,name,... | 41360 | 1.978 s | 68.3% |  |
24 | if (nargin == 4) && is... | 41360 | 0.514 s | 17.7% |  |
26 | return | 41360 | 0.066 s | 2.3% |  |
All other lines | | | 0.339 s | 11.7% |  |
Totals | | | 2.896 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
optimget>optimgetfast | subfunction | 41360 | 1.683 s | 58.1% |  |
Self time (built-ins, overhead, etc.) | | | 1.213 s | 41.9% |  |
Totals | | | 2.896 s | 100% | |
Code Analyzer results
Line number | Message |
68 | The variable 'msg' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 82 |
Non-code lines (comments, blank lines) | 33 |
Code lines (lines that can run) | 49 |
Code lines that did run | 3 |
Code lines that did not run | 46 |
Coverage (did run/can run) | 6.12 % |
Function listing
time calls line
1 function o = optimget(options,name,default,flag)
2 %OPTIMGET Get OPTIM OPTIONS parameters.
3 % VAL = OPTIMGET(OPTIONS,'NAME') extracts the value of the named parameter
4 % from optimization options structure OPTIONS, returning an empty matrix if
5 % the parameter value is not specified in OPTIONS. It is sufficient to
6 % type only the leading characters that uniquely identify the
7 % parameter. Case is ignored for parameter names. [] is a valid OPTIONS
8 % argument.
9 %
10 % VAL = OPTIMGET(OPTIONS,'NAME',DEFAULT) extracts the named parameter as
11 % above, but returns DEFAULT if the named parameter is not specified (is [])
12 % in OPTIONS. For example
13 %
14 % val = optimget(opts,'TolX',1e-4);
15 %
16 % returns val = 1e-4 if the TolX parameter is not specified in opts.
17 %
18 % See also OPTIMSET.
19
20 % Copyright 1984-2010 The MathWorks, Inc.
21 % $Revision: 1.20.4.16 $ $Date: 2010/11/17 11:26:33 $
22
23 % undocumented usage for fast access with no error checking
0.51 41360 24 if (nargin == 4) && isequal(flag,'fast')
1.98 41360 25 o = optimgetfast(options,name,default);
0.07 41360 26 return
27 end
28
29 if nargin < 2
30 error(message('MATLAB:optimget:NotEnoughInputs'));
31 end
32 if nargin < 3
33 default = [];
34 end
35
36 if ~isempty(options) && ~isa(options,'struct')
37 error(message('MATLAB:optimget:Arg1NotStruct'));
38 end
39
40 if isempty(options)
41 o = default;
42 return;
43 end
44
45 allfields = {'Display'; 'MaxFunEvals';'MaxIter';'TolFun';'TolX';'FunValCheck';'OutputFcn';'PlotFcns'};
46
47 % Include specialized options if appropriate
48 if uselargeoptimstruct
49 optimfields = optimoptiongetfields;
50 allfields = [allfields; optimfields];
51 end
52
53 Names = allfields;
54
55 name = deblank(name(:)'); % force this to be a row vector
56 j = find(strncmpi(name,Names,length(name)));
57 if isempty(j) % if no matches
58 error(message('MATLAB:optimget:InvalidPropName', name));
59 elseif length(j) > 1 % if more than one match
60 % Check for any exact matches (in case any names are subsets of others)
61 k = find(strcmpi(name,Names));
62 if length(k) == 1
63 j = k;
64 else
65 msg = sprintf('Ambiguous option name ''%s'' ', name);
66 msg = [msg '(' Names{j(1),:}];
67 for k = j(2:length(j))'
68 msg = [msg ', ' Names{k,:}];
69 end
70 msg = [msg, '.)'];
71 error('MATLAB:optimget:AmbiguousPropName', msg);
72 end
73 end
74
75 if any(strcmp(Names,Names{j,:}))
76 o = options.(Names{j,:});
77 if isempty(o)
78 o = default;
79 end
80 else
81 o = default;
82 end
Other subfunctions in this file are not included in this listing.