This is a static copy of a profile report

Home

strcat (1999 calls, 0.612 sec)
Generated 05-Aug-2011 13:01:01 using cpu time.
function in file /usr/local/MATLAB/R2011a/toolbox/matlab/strfun/strcat.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
searchStructfunction5
mergestructfunction1938
createDirfunction23
reduceDatafunction1
reduceData>writeOutFitssubfunction7
webpipefunction3
skim>date2strsubfunction6
webpipe>subpagessubfunction16
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
77
s0 =  blanks(space);
19990.066 s10.7%
76
space = sum(cellfun('prodofsiz...
19990.066 s10.7%
61
maxrows = max(rows);
19990.044 s7.1%
50
if all(rows == 0)
19990.044 s7.1%
107
end
19990.033 s5.4%
All other lines  0.361 s58.9%
Totals  0.612 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
blanksfunction19990.055 s8.9%
Self time (built-ins, overhead, etc.)  0.557 s91.1%
Totals  0.612 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
[ Show coverage for parent directory ]
Total lines in function107
Non-code lines (comments, blank lines)50
Code lines (lines that can run)57
Code lines that did run42
Code lines that did not run15
Coverage (did run/can run)73.68 %
Function listing
   time   calls  line
1 function t = strcat(varargin)
2 %STRCAT Concatenate strings.
3 % COMBINEDSTR = STRCAT(S1, S2, ..., SN) horizontally concatenates strings
4 % in arrays S1, S2, ..., SN. Inputs can be combinations of single
5 % strings, strings in scalar cells, character arrays with the same number
6 % of rows, and same-sized cell arrays of strings. If any input is a cell
7 % array, COMBINEDSTR is a cell array. Otherwise, COMBINEDSTR is a
8 % character array.
9 %
10 % Notes:
11 %
12 % For character array inputs, STRCAT removes trailing ASCII white-space
13 % characters: space, tab, vertical tab, newline, carriage return, and
14 % form-feed. To preserve trailing spaces when concatenating character
15 % arrays, use horizontal array concatenation, [s1, s2, ..., sN].
16 %
17 % For cell array inputs, STRCAT does not remove trailing white space.
18 %
19 % When combining nonscalar cell arrays and multi-row character arrays,
20 % cell arrays must be column vectors with the same number of rows as the
21 % character arrays.
22 %
23 % Example:
24 %
25 % strcat({'Red','Yellow'},{'Green','Blue'})
26 %
27 % returns
28 %
29 % 'RedGreen' 'YellowBlue'
30 %
31 % See also CAT, CELLSTR.
32
33 % Copyright 1984-2009 The MathWorks, Inc.
34 % $Revision: 1.16.4.8 $ $Date: 2010/08/23 23:13:26 $
35
36 % The cell array implementation is in @cell/strcat.m
37
1999 38 if nargin<1
39 error(message('MATLAB:strfun:Nargin')); end
40
41 % initialise return arguments
1999 42 t = '';
43
44 % get number of rows of each input
0.01 1999 45 rows = cellfun('size',varargin,1);
46 % get number of dimensions of each input
1999 47 twod = (cellfun('ndims',varargin) == 2);
48
49 % return empty string when all inputs are empty
0.04 1999 50 if all(rows == 0)
51 return;
52 end
0.01 1999 53 if ~all(twod)
54 error(message('MATLAB:strfun:InputDimension'));
55 end
56
57 % Remove empty inputs
1999 58 k = (rows == 0);
0.01 1999 59 varargin(k) = [];
0.03 1999 60 rows(k) = [];
0.04 1999 61 maxrows = max(rows);
62 % Scalar expansion
63
0.02 1999 64 for i=1:length(varargin),
0.02 5997 65 if rows(i)==1 && rows(i)<maxrows
66 varargin{i} = varargin{i}(ones(1,maxrows),:);
67 rows(i) = maxrows;
68 end
0.01 5997 69 end
70
1999 71 if any(rows~=rows(1)),
72 error(message('MATLAB:strcat:NumberOfInputRows'));
73 end
74
1999 75 n = rows(1);
0.07 1999 76 space = sum(cellfun('prodofsize',varargin));
0.07 1999 77 s0 = blanks(space);
1999 78 scell = cell(1,n);
0.01 1999 79 notempty = true(1,n);
0.03 1999 80 s = '';
0.03 1999 81 for i = 1:n
0.01 1999 82 s = s0;
0.01 1999 83 str = varargin{1}(i,:);
0.01 1999 84 if ~isempty(str) && (str(end) == 0 || isspace(str(end)))
85 str = char(deblank(str));
86 end
1999 87 pos = length(str);
1999 88 s(1:pos) = str;
1999 89 pos = pos + 1;
0.01 1999 90 for j = 2:length(varargin)
3998 91 str = varargin{j}(i,:);
0.02 3998 92 if ~isempty(str) && (str(end) == 0 || isspace(str(end)))
93 str = char(deblank(str));
94 end
3998 95 len = length(str);
0.02 3998 96 s(pos:pos+len-1) = str;
0.01 3998 97 pos = pos + len;
3998 98 end
0.01 1999 99 s = s(1:pos-1);
0.01 1999 100 notempty(1,i) = ~isempty(s);
0.01 1999 101 scell{1,i} = s;
0.01 1999 102 end
1999 103 if n > 1
104 t = char(scell{notempty});
1999 105 else
1999 106 t = s;
0.03 1999 107 end