This is a static copy of a profile report

Home

general/private/catdirs (1 call, 0.000 sec)
Generated 05-Aug-2011 13:00:29 using cpu time.
function in file /usr/local/MATLAB/R2011a/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
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
31
end
10 s0%
30
end
10 s0%
29
cdirs = [cdirs next pathsep];
10 s0%
28
if ~isempty(next)
10 s0%
27
next = strtrim(next);
10 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
pathsepfunction10 s0%
Self time (built-ins, overhead, etc.)  0 s0%
Totals  0 s0% 
Code Analyzer results
Line numberMessage
29The variable 'cdirs' appears to change size on every loop iteration. Consider preallocating for speed.
Coverage results
[ Show coverage for parent directory ]
Total lines in function31
Non-code lines (comments, blank lines)18
Code lines (lines that can run)13
Code lines that did run11
Code lines that did not run2
Coverage (did run/can run)84.62 %
Function listing
   time   calls  line
1 function cdirs = catdirs(varargin)
2 %CATDIRS Concatenate separate strings of directories into one string.
3 % CATDIRS DIRNAME checks that DIRNAME is a string, removes any leading
4 % or tailing whitespace, and appends a path separator.
5 %
6 % CATDIRS DIR1 DIR2 DIR3 ... for each input, checks it is a string, removes
7 % any leading or tailing whitespace, and appends a path separator; and then
8 % concatenates all these strings.
9 %
10 % Example:
11 % dirlist = catdirs('/home/user/matlab','/home/user/matlab/test');
12
13 % Copyright 1984-2009 The MathWorks, Inc.
14 % $Revision: 1.1.6.3 $ $Date: 2010/08/23 23:09:49 $
15
1 16 n= nargin;
1 17 error(nargchk(1,Inf,n,'struct'));
18
1 19 cdirs = '';
20
1 21 for i=1:n
1 22 next = varargin{i};
1 23 if ~ischar(next)
24 error(message('MATLAB:catdirs:ArgNotString'));
25 end
26 % Remove leading and trailing whitespace
1 27 next = strtrim(next);
1 28 if ~isempty(next)
1 29 cdirs = [cdirs next pathsep];
1 30 end
1 31 end