This is a static copy of a profile report

Home

readSpreadsheet>readDataFromSheet (Calls: 2, Time: 0.012 s)
Generated 04-Jun-2021 04:11:19 using performance time.
subfunction in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\io\spreadsheet\+matlab\+io\+spreadsheet\+internal\readSpreadsheet.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
readSpreadsheet>handleDataRangesubfunction2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
207
[variables{k},err,placeholder]...
60.008 s69.1%
206
varRange = subRange(dataRange,...
60.001 s7.1%
197
blankIDs = (typeIDs(:,selected...
20.000 s4.1%
216
end
60.000 s3.3%
196
typeIDs = sheet.types(dataRang...
20.000 s2.9%
All other lines  0.002 s13.5%
Totals  0.012 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
readSpreadsheetVariablefunction60.007 s54.5%
subRangefunction60.001 s5.2%
Self time (built-ins, overhead, etc.)  0.005 s40.2%
Totals  0.012 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function41
Non-code lines (comments, blank lines)9
Code lines (lines that can run)32
Code lines that did run24
Code lines that did not run8
Coverage (did run/can run)75.00 %
Function listing
time 
Calls 
 line
 177 
function [variables,missingIDs,errorIDs] = readDataFromSheet(sheet,dataRange,varOpts,selectedVarIDs)
 178 
    import matlab.io.spreadsheet.internal.subRange;
 179 
    
< 0.001 
      2 
 180
    numVars = numel(selectedVarIDs); 
< 0.001 
      2 
 181
    variables = cell(1,numVars); 
 182 
    % dataRange fails when it has width or height of zero
< 0.001 
      2 
 183
    if numVars == 0 
 184 
        missingIDs = false(dataRange(3:4));
 185 
        errorIDs = missingIDs;
 186 
        return
< 0.001 
      2 
 187
    end 
 188 
    % To read data, we want to turn get the two-corner version within the used
 189 
    % range.
< 0.001 
      2 
 190
    if any(dataRange(3:4)==0) 
 191 
        typeIDs = uint8.empty(dataRange(3:4));
 192 
        errorIDs = false(size(typeIDs));
 193 
        missingIDs = false(size(typeIDs));
 194 
        blankIDs = false(size(typeIDs));
< 0.001 
      2 
 195
    else 
< 0.001 
      2 
 196
        typeIDs = sheet.types(dataRange); 
< 0.001 
      2 
 197
        blankIDs = (typeIDs(:,selectedVarIDs) == sheet.BLANK)|(typeIDs(:,selectedVarIDs) == sheet.EMPTY); 
< 0.001 
      2 
 198
        errorIDs  = (typeIDs(:,selectedVarIDs) == sheet.ERROR); 
< 0.001 
      2 
 199
        missingIDs = false(size(errorIDs)); 
< 0.001 
      2 
 200
    end 
 201 

 202 

< 0.001 
      2 
 203
    for k = 1:numel(selectedVarIDs) 
 204 
        % Get data from the correct column.
< 0.001 
      6 
 205
        i = selectedVarIDs(k); 
< 0.001 
      6 
 206
        varRange = subRange(dataRange,i); 
  0.008 
      6 
 207
        [variables{k},err,placeholder] = matlab.io.spreadsheet.internal.readSpreadsheetVariable(varOpts{i}.Type,varOpts{i},sheet,varRange,typeIDs(:,i)); 
< 0.001 
      6 
 208
        missingIDs(placeholder,k) = true; 
< 0.001 
      6 
 209
        if strcmp(varOpts{i}.EmptyFieldRule,'error') 
 210 
            errorIDs(blankIDs(:,k),k) = true;
< 0.001 
      6 
 211
        elseif strcmp(varOpts{i}.EmptyFieldRule,'missing') 
< 0.001 
      6 
 212
            missingIDs(blankIDs(:,k),k) = true; 
< 0.001 
      6 
 213
        end 
< 0.001 
      6 
 214
        err(placeholder) = false; 
< 0.001 
      6 
 215
        errorIDs(err,k) = true; 
< 0.001 
      6 
 216
    end 
< 0.001 
      2 
 217
end 

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