This is a static copy of a profile report

Home

general/private/catdirs (Calls: 6, Time: 0.003 s)
Generated 18-Jul-2020 08:10:32 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/general/private/catdirs.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
addpathfunction6
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
41
cdirs = [cdirs trimmedNext pat...
60.001 s16.2%
22
for i=1:n
60.000 s14.5%
29
if ~isempty(trimmedNext)
60.000 s12.5%
43
end
60.000 s11.1%
23
next = varargin{i};
60.000 s11.1%
All other lines  0.001 s34.7%
Totals  0.003 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
pathsepfunction60.000 s2.0%
Self time (built-ins, overhead, etc.)  0.003 s98.0%
Totals  0.003 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function43
Non-code lines (comments, blank lines)19
Code lines (lines that can run)24
Code lines that did run14
Code lines that did not run10
Coverage (did run/can run)58.33 %
Function listing
time 
Calls 
 line
   1 
function cdirs = catdirs(caller, varargin)
   2 
%CATDIRS Concatenate separate strings of directories into one string. 
   3 
%   CATDIRS  CALLER DIRNAME checks that DIRNAME is a string, removes any
   4 
%   leading or tailing whitespace, and appends a path separator. CALLER is
   5 
%   the name of the calling function, used only when displaying warnings.
   6 
%
   7 
%   CATDIRS  CALLER DIR1 DIR2 DIR3 ... for each input, checks it is a
   8 
%    string, removes any leading or tailing whitespace, and appends a path
   9 
%    separator; and then concatenates all these strings. CALLER is the
  10 
%    name of the calling function, used only when displaying warnings.
  11 
%
  12 
%   Example:
  13 
%       dirlist = catdirs('addpath', '/home/user/matlab','/home/user/matlab/test');
  14 

  15 
%   Copyright 1984-2015 The MathWorks, Inc.
  16 

< 0.001 
      6 
  17
n= nargin-1; 
< 0.001 
      6 
  18
narginchk(2,Inf); 
  19 

< 0.001 
      6 
  20
cdirs = ''; 
  21 

< 0.001 
      6 
  22
for i=1:n 
< 0.001 
      6 
  23
    next = varargin{i}; 
< 0.001 
      6 
  24
    if ~ischar(next) 
  25 
        error(message('MATLAB:catdirs:ArgNotString'));
< 0.001 
      6 
  26
    end 
  27 
    % Remove leading and trailing whitespace
< 0.001 
      6 
  28
	trimmedNext = strtrim(next); 
< 0.001 
      6 
  29
    if ~isempty(trimmedNext) 
< 0.001 
      6 
  30
        if ~strcmp(trimmedNext, next) 
  31 
            [~,caller]=fileparts(caller);
  32 
            switch caller
  33 
                case 'addpath'
  34 
                    warning(message('MATLAB:catdirs:AddLeadingTrailingWhitespace', ...
  35 
                        trimmedNext, next));
  36 
                case 'rmpath'
  37 
                    warning(message('MATLAB:catdirs:RemoveLeadingTrailingWhitespace', ...
  38 
                        trimmedNext, next));
  39 
            end
< 0.001 
      6 
  40
        end 
< 0.001 
      6 
  41
        cdirs = [cdirs trimmedNext pathsep]; %#ok<AGROW> 
< 0.001 
      6 
  42
    end 
< 0.001 
      6 
  43
end 

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