HasPropertiesAsNVPairs>HasPropertiesAsNVPairs.parseInputs (Calls: 47, Time: 0.028 s)
Generated 04-Jun-2021 04:11:10 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\shared\io\general\+matlab\+io\+internal\+mixin\HasPropertiesAsNVPairs.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
...portOptions.TextVariableImportOptions | class method | 30 |
...mportOptions.SpreadsheetImportOptions | class method | 2 |
...tOptions.NumericVariableImportOptions | class method | 15 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
35 | obj.(param{:}) = results.(para... | 32 | 0.012 s | 41.9% | |
7 | p = getParserByClass(class(obj... | 47 | 0.004 s | 15.3% | |
9 | p.parse(argsIn{:}); | 47 | 0.002 s | 8.1% | |
40 | end | 467 | 0.001 s | 4.9% | |
31 | for param = names | 47 | 0.001 s | 4.1% | |
All other lines | 0.007 s | 25.7% | |||
Totals | 0.028 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
...ons>ImportOptions.set.NumVariables | class method | 2 | 0.004 s | 15.8% | |
HasPropertiesAsNVPairs>getParserByClass | class method | 47 | 0.004 s | 14.0% | |
VarOptsInputs>VarOptsInputs.set.Type | class method | 30 | 0.004 s | 13.6% | |
Self time (built-ins, overhead, etc.) | 0.016 s | 56.6% | |||
Totals | 0.028 s | 100% |
Total lines in function | 37 |
Non-code lines (comments, blank lines) | 8 |
Code lines (lines that can run) | 29 |
Code lines that did run | 25 |
Code lines that did not run | 4 |
Coverage (did run/can run) | 86.21 % |
time | Calls | line | |
---|---|---|---|
6 | function [obj, otherArgs] = parseInputs(obj,argsIn,priority) | ||
0.004 | 47 | 7 | p = getParserByClass(class(obj)); |
< 0.001 | 47 | 8 | if iscell(argsIn) |
0.002 | 47 | 9 | p.parse(argsIn{:}); |
10 | else % must be a struct. | ||
11 | p.parse(argsIn); | ||
< 0.001 | 47 | 12 | end |
13 | |||
14 | % Deal the results to the converter. | ||
< 0.001 | 47 | 15 | results = p.Results; |
< 0.001 | 47 | 16 | defaults = string(p.UsingDefaults); |
< 0.001 | 47 | 17 | if exist('priority','var') |
18 | % Inputs are assigned in the order they appear in the argument list. | ||
19 | % To change this order, move any proprties which may have dependencies to | ||
20 | % the beginning of the list. | ||
< 0.001 | 2 | 21 | names = p.Parameters(:)'; |
< 0.001 | 2 | 22 | names(any(names(:)==defaults(:)',2)) = []; |
< 0.001 | 2 | 23 | for i = numel(priority):-1:1 |
< 0.001 | 8 | 24 | tomove = strcmpi(names,priority(i)); |
< 0.001 | 8 | 25 | names = [names(tomove) names(~tomove)]; |
< 0.001 | 8 | 26 | end |
< 0.001 | 45 | 27 | else |
< 0.001 | 45 | 28 | names = p.Parameters; |
< 0.001 | 47 | 29 | end |
30 | |||
0.001 | 47 | 31 | for param = names |
32 | % only set the ones given by the user. | ||
< 0.001 | 467 | 33 | if ~any(param==defaults) |
< 0.001 | 32 | 34 | try |
0.012 | 32 | 35 | obj.(param{:}) = results.(param{:}); |
36 | catch ME | ||
37 | throwAsCaller(ME) | ||
< 0.001 | 32 | 38 | end |
< 0.001 | 467 | 39 | end |
0.001 | 467 | 40 | end |
0.001 | 47 | 41 | otherArgs = p.Unmatched; |
< 0.001 | 47 | 42 | end |
Other subfunctions in this file are not included in this listing.