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: 1, Time: 0.001 s)
Generated 19-Apr-2020 09:41:41 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
addpathfunction1
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
41
cdirs = [cdirs trimmedNext pat...
10.000 s16.2%
29
if ~isempty(trimmedNext)
10.000 s14.5%
22
for i=1:n
10.000 s11.9%
23
next = varargin{i};
10.000 s10.3%
28
trimmedNext = strtrim(next);
10.000 s6.4%
All other lines  0.001 s40.7%
Totals  0.001 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
pathsepfunction10.000 s1.3%
Self time (built-ins, overhead, etc.)  0.001 s98.7%
Totals  0.001 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 
      1 
  17
n= nargin-1; 
< 0.001 
      1 
  18
narginchk(2,Inf); 
  19 

< 0.001 
      1 
  20
cdirs = ''; 
  21 

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

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