general/private/catdirs (2 calls, 0.010 sec)
Generated 14-Nov-2016 07:47:09 using cpu time.
function in file /usr/local/MATLAB/MATLAB_Production_Server/R2015a/toolbox/matlab/general/private/catdirs.m
Copy to new window for comparing multiple runs
Function Name | Function Type | Calls |
addpath | function | 2 |
Line Number | Code | Calls | Total Time | % Time | Time Plot |
26 | next = strtrim(next); | 2 | 0.010 s | 100.0% | ![]() |
30 | end | 2 | 0 s | 0% | ![]() |
29 | end | 2 | 0 s | 0% | ![]() |
28 | cdirs = [cdirs next pathsep]; ... | 2 | 0 s | 0% | ![]() |
27 | if ~isempty(next) | 2 | 0 s | 0% | ![]() |
All other lines | 0 s | 0% | ![]() | ||
Totals | 0.010 s | 100% |
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
pathsep | function | 2 | 0 s | 0% | ![]() |
Self time (built-ins, overhead, etc.) | 0.010 s | 100.0% | ![]() | ||
Totals | 0.010 s | 100% |
Total lines in function | 30 |
Non-code lines (comments, blank lines) | 17 |
Code lines (lines that can run) | 13 |
Code lines that did run | 11 |
Code lines that did not run | 2 |
Coverage (did run/can run) | 84.62 % |
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-2011 The MathWorks, Inc. | ||
14 | |||
2 | 15 | n= nargin; | |
2 | 16 | narginchk(1,Inf); | |
17 | |||
2 | 18 | cdirs = ''; | |
19 | |||
2 | 20 | for i=1:n | |
2 | 21 | next = varargin{i}; | |
2 | 22 | if ~ischar(next) | |
23 | error(message('MATLAB:catdirs:ArgNotString')); | ||
24 | end | ||
25 | % Remove leading and trailing whitespace | ||
0.01 | 2 | 26 | next = strtrim(next); |
2 | 27 | if ~isempty(next) | |
2 | 28 | cdirs = [cdirs next pathsep]; %#ok<AGROW> | |
2 | 29 | end | |
2 | 30 | end |