This is a static copy of a profile report

Home

DetectImportOptions>DetectImportOptions.execute (Calls: 2, Time: 0.225 s)
Generated 04-Jun-2021 04:11:20 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\io\functions\+matlab\+io\+internal\+functions\DetectImportOptions.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ReadTable>ReadTable.executeclass method2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
65
opts = func.execute@matlab.io....
20.221 s98.1%
129
opts = opts.setUnboundedSelect...
20.001 s0.5%
130
opts = opts.useGeneratedNames(...
20.001 s0.5%
127
opts.PreserveVariableNames = f...
20.001 s0.4%
76
if supplied.MultipleDelimsAsOn...
20.000 s0.1%
All other lines  0.001 s0.5%
Totals  0.225 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
...etectImportOptionsSpreadsheet.executeclass method20.221 s98.0%
...ns>ImportOptions.useGeneratedNamesclass method20.001 s0.3%
...t;ImportOptions.setUnboundedSelectionclass method20.001 s0.3%
...eNamesInput.set.PreserveVariableNamesclass method20.000 s0.2%
...eNamesInput.get.PreserveVariableNamesclass method20.000 s0.0%
Self time (built-ins, overhead, etc.)  0.003 s1.3%
Totals  0.225 s100% 
Code Analyzer results
Line numberMessage
73A Code Analyzer message was once suppressed here, but the message is no longer generated.
91A Code Analyzer message was once suppressed here, but the message is no longer generated.
101A Code Analyzer message was once suppressed here, but the message is no longer generated.
Coverage results
Show coverage for parent directory
Total lines in function73
Non-code lines (comments, blank lines)17
Code lines (lines that can run)56
Code lines that did run25
Code lines that did not run31
Coverage (did run/can run)44.64 %
Function listing
time 
Calls 
 line
  59 
        function opts = execute(func,supplied)
  60 
            % Detect the appropriate object by file type
< 0.001 
      2 
  61
            switch func.FileType 
< 0.001 
      2 
  62
                case {'text','delimitedtext','fixedwidth'} 
  63 
                    opts = func.execute@matlab.io.internal.functions.DetectImportOptionsText(supplied);
< 0.001 
      2 
  64
                case 'spreadsheet' 
  0.221 
      2 
  65
                    opts = func.execute@matlab.io.internal.functions.DetectImportOptionsSpreadsheet(supplied); 
  66 
                otherwise
  67 
                    assert(false);
< 0.001 
      2 
  68
            end 
  69 
            
< 0.001 
      2 
  70
            if supplied.EmptyValue 
  71 
                sfillValue = struct("FillValue", func.EmptyValue);
  72 
                idx = find(ismember(opts.fast_var_opts.Types,["double","auto"]));
  73 
                opts.fast_var_opts = opts.fast_var_opts.assignVarOptsProps(sfillValue, "FillValue", idx); %#ok<FNDSB>
      2 
  74
            end 
  75 
            
< 0.001 
      2 
  76
            if supplied.MultipleDelimsAsOne 
  77 
                supplied.ConsecutiveDelimitersRule = true;
  78 
                supplied.LeadingDelimitersRule = true;
< 0.001 
      2 
  79
            end 
  80 
            
< 0.001 
      2 
  81
            textType = func.TextType; 
  82 
            
< 0.001 
      2 
  83
            if supplied.DatetimeType 
  84 
                dtType = func.DatetimeType;
  85 
                if dtType =="text"
  86 
                    dtType = textType;
  87 
                elseif dtType == "exceldatenum"
  88 
                    dtType = "double";
  89 
                end
  90 
                idx = find(opts.VariableTypes == "datetime");
  91 
                opts.fast_var_opts = opts.fast_var_opts.setTypes(idx,convertStringsToChars(dtType)); %#ok<FNDSB>
< 0.001 
      2 
  92
            end 
  93 
            
< 0.001 
      2 
  94
            if supplied.DurationType 
  95 
                if func.DurationType=="text"
  96 
                    dtType = textType;
  97 
                else
  98 
                    dtType = func.DurationType;
  99 
                end
 100 
                idx = find(opts.VariableTypes == "duration");
 101 
                opts.fast_var_opts = opts.fast_var_opts.setTypes(idx,convertStringsToChars(dtType)); %#ok<FNDSB>
 102 

< 0.001 
      2 
 103
            end 
 104 
            
 105 
            % Default TextType for text and spreadsheet is char
< 0.001 
      2 
 106
            if supplied.TextType && (textType == "string") 
 107 
                idx = find(opts.VariableTypes == "char");
 108 
                if ~isempty(idx)
 109 
                    opts.fast_var_opts = opts.fast_var_opts.setTypes(idx,"string");
 110 
                end
< 0.001 
      2 
 111
            end 
 112 
            
 113 
            % Default TextType for XML is string
< 0.001 
      2 
 114
            if supplied.TextType && (textType == "char") 
 115 
                idx = find(opts.VariableTypes == "string");
 116 
                if ~isempty(idx)
 117 
                    opts.fast_var_opts = opts.fast_var_opts.setTypes(idx,"char");
 118 
                end
      2 
 119
            end 
 120 
            
< 0.001 
      2 
 121
            if supplied.ImportErrorRule,  opts.ImportErrorRule  = func.ImportErrorRule;  end 
< 0.001 
      2 
 122
            if supplied.MissingRule,      opts.MissingRule      = func.MissingRule;      end 
< 0.001 
      2 
 123
            if supplied.ExtraColumnsRule, opts.ExtraColumnsRule = func.ExtraColumnsRule; end 
 124 
            
 125 
            % Set PreserveVariableNames on the generated text/spreadsheet
 126 
            % opts object.
< 0.001 
      2 
 127
            opts.PreserveVariableNames = func.PreserveVariableNames; 
 128 
            
  0.001 
      2 
 129
            opts = opts.setUnboundedSelection(true); 
  0.001 
      2 
 130
            opts = opts.useGeneratedNames(0); 
< 0.001 
      2 
 131
        end 

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