This is a static copy of a profile report

Home

ArgumentParser>ArgumentParser.extractArgs (Calls: 2, Time: 0.005 s)
Generated 04-Jun-2021 04:11:06 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\shared\io\general\+matlab\+io\+internal\+validators\ArgumentParser.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...;ExecutableFunction.validateArgumentsclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
114
for n = matches(:,any(matches,...
20.001 s15.3%
124
otherArgs(1:2:2*numArgs) = cel...
20.000 s10.9%
126
otherArgs(2:2:2*numArgs) = val...
20.000 s10.7%
112
matches = (inputNames(:) == al...
20.000 s8.9%
107
[inputNames{:}] = convertStrin...
20.000 s8.1%
All other lines  0.002 s46.1%
Totals  0.005 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function26
Non-code lines (comments, blank lines)9
Code lines (lines that can run)17
Code lines that did run17
Code lines that did not run0
Coverage (did run/can run)100.00 %
Function listing
time 
Calls 
 line
 102 
        function [paramStruct, otherArgs] = extractArgs(obj,varargin)
 103 
        % Extracts any argments known by this interface, and sets the
 104 
        % others aside. Parameter names are expected to be canonicalized
 105 
        % already. (i.e. partial matching needs to have already been done.)
< 0.001 
      2 
 106
        inputNames = varargin(1:2:end)'; 
< 0.001 
      2 
 107
        [inputNames{:}] = convertStringsToChars(inputNames{:}); 
< 0.001 
      2 
 108
        inputNames = convertCharsToStrings(inputNames); 
< 0.001 
      2 
 109
        allNames = obj.ParameterNames; 
 110 
        
 111 
        % Does implicit expansion to find the matches
< 0.001 
      2 
 112
        matches = (inputNames(:) == allNames(:)'); 
< 0.001 
      2 
 113
        paramStruct = struct(); 
< 0.001 
      2 
 114
        for n = matches(:,any(matches,1)) 
< 0.001 
      1 
 115
            k = find(n,1,'last'); 
< 0.001 
      1 
 116
            paramStruct.(inputNames(k)) = varargin{2*k}; 
< 0.001 
      1 
 117
        end 
 118 
        
 119 
        % None of the values matches the names
< 0.001 
      2 
 120
        nonMatches = ~any(matches,2); 
< 0.001 
      2 
 121
        numArgs = nnz(nonMatches); 
 122 
        % Rebuild the other args for non-matches items
< 0.001 
      2 
 123
        otherArgs = cell(1,numArgs); 
< 0.001 
      2 
 124
        otherArgs(1:2:2*numArgs) = cellstr(inputNames(nonMatches)); 
< 0.001 
      2 
 125
        values = varargin(2:2:end)'; 
< 0.001 
      2 
 126
        otherArgs(2:2:2*numArgs) = values(nonMatches); 
< 0.001 
      2 
 127
        end 

Other subfunctions in this file are not included in this listing.