This is a static copy of a profile reportHome
cell.strcat (20 calls, 0.020 sec)
Generated 05-Nov-2014 07:52:33 using cpu time.
function in file /usr1/opt/matlab/7.13/toolbox/matlab/strfun/@cell/strcat.m
Copy to new window for comparing multiple runs
Parents (calling functions)
Lines where the most time was spent
Line Number | Code | Calls | Total Time | % Time | Time Plot |
43 | if prod(siz{i})==1, | 60 | 0.010 s | 50.0% |  |
25 | siz{i} = size(varargin{i}); | 60 | 0.010 s | 50.0% |  |
61 | end | 20 | 0 s | 0% |  |
60 | t{i} = [s{:,i}]; | 20 | 0 s | 0% |  |
59 | for i=1:prod(maxsiz), | 20 | 0 s | 0% |  |
All other lines | | | 0 s | 0% |  |
Totals | | | 0.020 s | 100% | |
Children (called functions)
Function Name | Function Type | Calls | Total Time | % Time | Time Plot |
cellstr | function | 40 | 0 s | 0% |  |
Self time (built-ins, overhead, etc.) | | | 0.020 s | 100.0% |  |
Totals | | | 0.020 s | 100% | |
Code Analyzer results
Line number | Message |
20 | The variable 'emptyIdx' appears to change size on every loop iteration. Consider preallocating for speed. |
Coverage results
[ Show coverage for parent directory ]
Total lines in function | 61 |
Non-code lines (comments, blank lines) | 19 |
Code lines (lines that can run) | 42 |
Code lines that did run | 31 |
Code lines that did not run | 11 |
Coverage (did run/can run) | 73.81 % |
Function listing
time calls line
1 function t = strcat(varargin)
2 %STRCAT String horizontal concatenation.
3 % T = STRCAT(S1,S2,...), when any of the inputs is a cell array of
4 % strings, returns a cell array of strings formed by concatenating
5 % corresponding elements of S1,S2, etc. The inputs must all have
6 % the same size (or any can be a scalar).
7
8 % Copyright 1984-2006 The MathWorks, Inc.
9 % $Revision: 1.9.4.4 $ $Date: 2010/08/23 23:13:30 $
10
20 11 error(nargchk(1, inf, nargin, 'struct'));
12
13 % Make sure everything is a cell array
20 14 maxsiz = [1 1];
20 15 emptyIdx = [];
20 16 siz = cell(1, nargin);
20 17 tf = false(1,nargin);
20 18 for i=1:nargin,
60 19 if (isempty(varargin{i}))
20 emptyIdx(i) = i;
21 end
60 22 if ischar(varargin{i}),
40 23 varargin{i} = cellstr(varargin{i});
40 24 end
0.01 60 25 siz{i} = size(varargin{i});
60 26 if prod(siz{i})>prod(maxsiz),
27 maxsiz = siz{i};
28 end
60 29 tf(i) = iscell(varargin{i});
60 30 end
31
20 32 if ~isempty(emptyIdx)
33 emptyIdx = find(emptyIdx);
34 varargin(emptyIdx) = [];
35 tf(emptyIdx) = [];
36 siz(emptyIdx) = [];
37 end
38
20 39 if ~all(tf), error(message('MATLAB:strcat:InvalidInputType')); end
40
41 % Scalar expansion
20 42 for i=1:length(varargin),
0.01 60 43 if prod(siz{i})==1,
60 44 varargin{i} = varargin{i}(ones(maxsiz));
60 45 siz{i} = size(varargin{i});
60 46 end
60 47 end
48
20 49 if ((numel(siz) > 1) && ~isequal(siz{:})),
50 error(message('MATLAB:strcat:InvalidInputSize'));
51 end
52
20 53 s = cell([length(varargin) maxsiz]);
20 54 for i=1:length(varargin),
60 55 s(i,:) = varargin{i}(:);
60 56 end
57
20 58 t = cell(maxsiz);
20 59 for i=1:prod(maxsiz),
20 60 t{i} = [s{:,i}];
20 61 end