This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
...ons>ImportOptions.getVarOptsStructclass method4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
194
s{ii} = getOptsStructWithDefau...
120.003 s42.9%
183
idx = obj.fixSelection(idx);
40.002 s30.2%
195
end
120.001 s8.8%
179
C = obj.OptionsStruct.Options;
40.000 s5.2%
193
for ii = 1:n
40.000 s3.3%
All other lines  0.001 s9.5%
Totals  0.007 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
FastVarOpts>getOptsStructWithDefaultsclass method120.003 s35.0%
FastVarOpts>FastVarOpts.fixSelectionclass method40.002 s21.5%
Self time (built-ins, overhead, etc.)  0.003 s43.5%
Totals  0.007 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function37
Non-code lines (comments, blank lines)14
Code lines (lines that can run)23
Code lines that did run17
Code lines that did not run6
Coverage (did run/can run)73.91 %
Function listing
time 
Calls 
 line
 169 
        function s = getVarOptsStruct(obj,idx,setnames)
 170 
            % s = opts.getVarOptsStruct() gets all the struct options with
 171 
            %     default vales, names which have been set, and default
 172 
            %     names for any variables without a set names.
 173 
            %
 174 
            % s = opts.getVarOptsStruct(idx,setnames) gets the struct
 175 
            %     options with defaults values. If SETNAMES = true, the names
 176 
            %     are copied to the struct, otherwise, the names are empty.
 177 
            %
 178 
            
< 0.001 
      4 
 179
            C = obj.OptionsStruct.Options; 
< 0.001 
      4 
 180
            if nargin < 2 
 181 
                idx = 1:numel(C);
< 0.001 
      4 
 182
            else 
  0.002 
      4 
 183
                idx = obj.fixSelection(idx); 
< 0.001 
      4 
 184
            end 
< 0.001 
      4 
 185
            n = numel(idx); 
< 0.001 
      4 
 186
            types = obj.OptionsStruct.Types; 
< 0.001 
      4 
 187
            if ~obj.NeedsUniformCheck && numel(idx) > 0 
 188 
                % Uniform Options, get the first, and replicate it.
 189 
                s = repmat({getOptsStructWithDefaults(types{idx(1)},C{idx(1)})},1,n);
< 0.001 
      4 
 190
            else 
 191 
                % get all the options; they might be uniform, might not.
< 0.001 
      4 
 192
                s = cell(1,n); 
< 0.001 
      4 
 193
                for ii = 1:n 
  0.003 
     12 
 194
                    s{ii} = getOptsStructWithDefaults(types{idx(ii)},C{idx(ii)}); 
< 0.001 
     12 
 195
                end 
< 0.001 
      4 
 196
            end 
< 0.001 
      4 
 197
            if nargin > 2 && setnames 
 198 
                % Set the names, obj.Names generates the default
 199 
                % Var1,...,VarN names in place.
 200 
                names = obj.Names;
 201 
                for ii = 1:n
 202 
                    s{ii}.Name = names{idx(ii)};
 203 
                end
      4 
 204
            end 
< 0.001 
      4 
 205
        end 

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