This is a static copy of a profile report

Home

varNamesDim>varNamesDim.setUnits (Calls: 2, Time: 0.001 s)
Generated 04-Jun-2021 04:11:13 using performance time.
class method in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\datatypes\tabular\+matlab\+internal\+tabular\+private\varNamesDim.m
Copy to new window for comparing multiple runs

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
557
if ~matlab.internal.datatypes....
20.001 s57.3%
572
obj.hasUnits = false;
20.000 s8.2%
577
obj.units = newUnits;
20.000 s7.4%
570
elseif isempty(newUnits)
20.000 s6.5%
556
if (nargin<3) || (nargin==3...
20.000 s6.3%
All other lines  0.000 s14.3%
Totals  0.001 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
isTextfunction20.000 s35.2%
Self time (built-ins, overhead, etc.)  0.001 s64.8%
Totals  0.001 s100% 
Code Analyzer results
Line numberMessage
Coverage results
Show coverage for parent directory
Total lines in function24
Non-code lines (comments, blank lines)3
Code lines (lines that can run)21
Code lines that did run14
Code lines that did not run7
Coverage (did run/can run)66.67 %
Function listing
time 
Calls 
 line
 555 
        function obj = setUnits(obj,newUnits,noErrorCheck)
< 0.001 
      2 
 556
            if (nargin<3) || (nargin==3 && ~noErrorCheck) 
< 0.001 
      2 
 557
                if ~matlab.internal.datatypes.isText(newUnits,true) % require a cell array, allow empty character vectors 
 558 
                    error(message('MATLAB:table:InvalidUnits'));
< 0.001 
      2 
 559
                elseif ~isempty(newUnits) && numel(newUnits) ~= obj.length 
 560 
                    error(message('MATLAB:table:IncorrectNumberOfUnits'));
      2 
 561
                end 
      2 
 562
            end 
 563 
            
< 0.001 
      2 
 564
            if isstring(newUnits) 
 565 
                newUnits = cellstr(newUnits);
      2 
 566
            end 
< 0.001 
      2 
 567
            if obj.length == 0 && isequal(size(newUnits),[1 0]) 
 568 
                % leave a 1x0 cell alone for a table with no vars
 569 
                obj.hasUnits = true;
< 0.001 
      2 
 570
            elseif isempty(newUnits) 
< 0.001 
      2 
 571
                newUnits = {}; % for cosmetics 
< 0.001 
      2 
 572
                obj.hasUnits = false; 
 573 
            else
 574 
                newUnits = strtrim(newUnits(:))'; % a row vector
 575 
                obj.hasUnits = true;
< 0.001 
      2 
 576
            end 
< 0.001 
      2 
 577
            obj.units = newUnits; 
< 0.001 
      2 
 578
        end 

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