This is a static copy of a profile report

Home

tabularDimension>tabularDimension.checkDuplicateLabels (Calls: 16, Time: 0.006 s)
Generated 16-Jul-2020 17:09:51 using performance time.
class method in file /Applications/MATLAB_R2020a.app/toolbox/matlab/datatypes/tabular/+matlab/+internal/+tabular/+private/tabularDimension.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
...t;varNamesDim.validateAndAssignLabelsclass method8
...t;rowNamesDim.validateAndAssignLabelsclass method8
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
453
duplicated(2:end) = strcmp(lab...
160.003 s54.0%
452
[labels1Sorted,lids] = sort(la...
160.001 s19.3%
449
if nargin == 2 % checkDuplicat...
160.000 s6.2%
451
duplicated = false(size(labels...
160.000 s4.6%
495
end
160.000 s2.1%
All other lines  0.001 s13.8%
Totals  0.006 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function51
Non-code lines (comments, blank lines)19
Code lines (lines that can run)32
Code lines that did run10
Code lines that did not run22
Coverage (did run/can run)31.25 %
Function listing
time 
Calls 
 line
 445 
        function [tf,duplicated] = checkDuplicateLabels(obj,labels1,labels2,okLocs)
 446 
            %CHECKDUPLICATELABELS Check for duplicated names.
 447 
            
 448 
            % Check for any duplicate names in names1            
< 0.001 
     16 
 449
            if nargin == 2 % checkDuplicateLabels(obj,labels1) 
 450 
                % names1 is always a cellstr
< 0.001 
     16 
 451
                duplicated = false(size(labels1)); 
  0.001 
     16 
 452
                [labels1Sorted,lids] = sort(labels1); 
  0.003 
     16 
 453
                duplicated(2:end) = strcmp(labels1Sorted(1:end-1),labels1Sorted(2:end)); 
 454 
                % Put duplicated back in the original order.
< 0.001 
     16 
 455
                duplicated(lids) = duplicated;  
 456 
                
 457 
            % Check if any name in names1 is already in names2, except that
 458 
            % names1(i) may be at names2(okLocs(i)).  This does not check if
 459 
            % names1 contains duplicates within itself
 460 
            elseif nargin == 4 % checkDuplicateLabels(obj,labels1,labels2,okLocs)
 461 
                % names2 is always a cellstr
 462 
                if ischar(labels1) % names1 is either a single character vector ...
 463 
                    tmp = strcmp(labels1, labels2); tmp(okLocs) = false;
 464 
                    duplicated = any(tmp);
 465 
                else             % ... or a cell array of character vectors
 466 
                    duplicated = false(size(labels1));
 467 
                    for i = 1:length(labels1) %#ok<CPROPLC>
 468 
                        tmp = strcmp(labels1{i}, labels2); tmp(okLocs(i)) = false;
 469 
                        duplicated(i) = any(tmp);
 470 
                    end
 471 
                end
 472 
                
 473 
            % Check if any name in names1 is already in names2.  This does not check if
 474 
            % names1 contains duplicates within itself
 475 
            else % nargin==3, checkDuplicateLabels(obj,labels1,labels2) - least frequent syntax
 476 
                % names2 is always a cellstr
 477 
                if ischar(labels1) % names1 is either a single character vector ...
 478 
                    duplicated = any(strcmp(labels1, labels2));
 479 
                else             % ... or a cell array of character vectors
 480 
                    duplicated = false(size(labels1));
 481 
                    for i = 1:length(labels1) %#ok<CPROPLC>
 482 
                        duplicated(i) = any(strcmp(labels1{i}, labels2));
 483 
                    end
 484 
                end
 485 
                
 486 
            
< 0.001 
     16 
 487
            end 
 488 
            
< 0.001 
     16 
 489
            tf = any(duplicated); 
 490 
            
< 0.001 
     16 
 491
            if tf && obj.requireUniqueLabels && (nargout == 0) 
 492 
                allDups = labels1(duplicated); 
 493 
                throwAsCaller(MException(message(obj.DuplicateLabelExceptionID,allDups{1}))); % Report the first dup in the message
< 0.001 
     16 
 494
            end 
< 0.001 
     16 
 495
        end 

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