This is a static copy of a profile report

Home

tabular.getVarOrRowLabelData (Calls: 3, Time: 0.001 s)
Generated 04-Jun-2021 04:11:26 using performance time.
function in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\datatypes\tabular\@tabular\getVarOrRowLabelData.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
tabular.sortrowsFlagChecksfunction3
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
32
varData = t.data(varIndices);
30.000 s47.8%
33
end
30.000 s0.2%
9
isRowLabels = (varIndices == 0...
30.000 s0.2%
31
else
30.000 s0.0%
10
if any(isRowLabels)
30.000 s0.0%
All other lines  0.001 s51.7%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function33
Non-code lines (comments, blank lines)14
Code lines (lines that can run)19
Code lines that did run5
Code lines that did not run14
Coverage (did run/can run)26.32 %
Function listing
time 
Calls 
 line
   1 
function varData = getVarOrRowLabelData(t,varIndices,wmsgid)
   2 
% Return the specified data vars and/or the row labels, wrapped up in a cell
   3 
% array. A var index of 0 indicates row labels. This is useful for collecting up
   4 
% sorting/grouping vars in methods like sortrows or varfun, but is not needed
   5 
% where only data vars are legal, e.g. InputVariables in varfun.
   6 

   7 
%   Copyright 2016-2017 The MathWorks, Inc.
   8 

< 0.001 
      3 
   9
isRowLabels = (varIndices == 0); 
< 0.001 
      3 
  10
if any(isRowLabels) 
  11 
    if t.rowDim.hasLabels
  12 
        rowLabels = t.rowDim.labels;
  13 
    else
  14 
        % If there _are_ no row labels, warn and use the row indices.
  15 
        % Timetable row times are required, this can only happen for
  16 
        % tables. Error if a caller ends up here, has no row labels, and
  17 
        % has not provided a warning id.
  18 
        warning(message(wmsgid));
  19 
        rowLabels = (1:t.rowDim.length)';
  20 
    end
  21 
    if isscalar(varIndices)
  22 
        % If it's only the row labels, return quickly.
  23 
        varData = { rowLabels };
  24 
        return
  25 
    end
  26 
    
  27 
    varData = cell(1,length(varIndices));
  28 
    varData(isRowLabels) = { rowLabels };
  29 
    isDataVar = ~isRowLabels;
  30 
    varData(isDataVar) = t.data(varIndices(isDataVar));
< 0.001 
      3 
  31
else 
< 0.001 
      3 
  32
    varData = t.data(varIndices); 
< 0.001 
      3 
  33
end 

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