This is a static copy of a profile report

Home

Function details for general/private/catdirsThis is a static copy of a profile report

Home

general/private/catdirs (Calls: 5, Time: 0.003 s)
Generated 28-Jun-2020 22:32:29 using performance time.
function in file /Applications/MATLAB_R2018a.app/toolbox/matlab/general/private/catdirs.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
addpathfunction5
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
41
cdirs = [cdirs trimmedNext pat...
50.000 s16.6%
29
if ~isempty(trimmedNext)
50.000 s12.4%
23
next = varargin{i};
50.000 s10.3%
22
for i=1:n
50.000 s9.4%
28
trimmedNext = strtrim(next);
50.000 s8.7%
All other lines  0.001 s42.6%
Totals  0.003 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
pathsepfunction50.000 s2.7%
Self time (built-ins, overhead, etc.)  0.003 s97.3%
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 run12
Code lines that did not run12
Coverage (did run/can run)50.00 %
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 
      5 
  17
n= nargin-1; 
< 0.001 
      5 
  18
narginchk(2,Inf); 
  19 

< 0.001 
      5 
  20
cdirs = ''; 
  21 

< 0.001 
      5 
  22
for i=1:n 
< 0.001 
      5 
  23
    next = varargin{i}; 
< 0.001 
      5 
  24
    if ~ischar(next) 
  25 
        error(message('MATLAB:catdirs:ArgNotString'));
  26 
    end
  27 
    % Remove leading and trailing whitespace
< 0.001 
      5 
  28
	trimmedNext = strtrim(next); 
< 0.001 
      5 
  29
    if ~isempty(trimmedNext) 
< 0.001 
      5 
  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
  40 
        end
< 0.001 
      5 
  41
        cdirs = [cdirs trimmedNext pathsep]; %#ok<AGROW> 
< 0.001 
      5 
  42
    end 
< 0.001 
      5 
  43
end 

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