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: 6, Time: 0.002 s)
Generated 02-May-2020 21:54:21 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
addpathfunction6
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
41
cdirs = [cdirs trimmedNext pat...
60.000 s21.1%
29
if ~isempty(trimmedNext)
60.000 s12.0%
22
for i=1:n
60.000 s10.1%
23
next = varargin{i};
60.000 s9.6%
28
trimmedNext = strtrim(next);
60.000 s8.0%
All other lines  0.001 s39.2%
Totals  0.002 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
pathsepfunction60.000 s3.9%
Self time (built-ins, overhead, etc.)  0.002 s96.1%
Totals  0.002 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 
      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'));
  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
  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.