This is a static copy of a profile report

Home

cell.strcat (Calls: 102, Time: 0.018 s)
Generated 16-Jul-2020 17:09:12 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/strfun/@cell/strcat.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
string.strcatfunction2
hhsave_VFI_3OCfunction100
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
17
varargin{i} = cellstr(varargin...
1040.003 s17.3%
38
varargin{i} = varargin{i}(ones...
2060.002 s11.6%
49
s(i, :) = varargin{i}(:);
2060.002 s9.7%
54
t{i} = [s{:, i}];
1020.001 s7.0%
43
if (numel(siz) > 1) &&a...
1020.001 s6.2%
All other lines  0.009 s48.2%
Totals  0.018 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
cellstrfunction1040.002 s11.8%
Self time (built-ins, overhead, etc.)  0.016 s88.2%
Totals  0.018 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function55
Non-code lines (comments, blank lines)17
Code lines (lines that can run)38
Code lines that did run31
Code lines that did not run7
Coverage (did run/can run)81.58 %
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 
%   character vectors, returns a cell array of character vectors formed by
   5 
%   concatenating corresponding elements of S1,S2, etc.  The inputs must
   6 
%   all have the same size (or any can be a scalar).
   7 

   8 
%   Copyright 1984-2016 The MathWorks, Inc.
   9 

< 0.001 
    102 
  10
narginchk(1, inf); 
  11 

  12 
% Make sure everything is a cell array
< 0.001 
    102 
  13
maxsiz = -1; 
< 0.001 
    102 
  14
siz = cell(1, nargin); 
< 0.001 
    102 
  15
for i = 1:nargin 
< 0.001 
    206 
  16
    if ischar(varargin{i}) 
  0.003 
    104 
  17
        varargin{i} = cellstr(varargin{i}); 
< 0.001 
    102 
  18
    elseif ~iscell(varargin{i}) 
  19 
        if isempty(varargin{i})
  20 
            varargin{i} = {''};
  21 
        else
  22 
            error(message('MATLAB:strcat:InvalidInputType'));
  23 
        end
< 0.001 
    206 
  24
    end 
< 0.001 
    206 
  25
    siz{i} = size(varargin{i}); 
< 0.001 
    206 
  26
    if ~isscalar(varargin{i}) && prod(siz{i}) > prod(maxsiz) 
  27 
        maxsiz = siz{i};
< 0.001 
    206 
  28
    end 
< 0.001 
    206 
  29
end 
  30 

< 0.001 
    102 
  31
if isequal(maxsiz, -1) 
< 0.001 
    102 
  32
    maxsiz = [1, 1]; 
< 0.001 
    102 
  33
end 
  34 

  35 
% Scalar coercion
< 0.001 
    102 
  36
for i = 1:length(varargin) 
< 0.001 
    206 
  37
    if prod(siz{i}) == 1 
  0.002 
    206 
  38
        varargin{i} = varargin{i}(ones(maxsiz)); 
< 0.001 
    206 
  39
        siz{i} = size(varargin{i}); 
< 0.001 
    206 
  40
    end 
< 0.001 
    206 
  41
end 
  42 

  0.001 
    102 
  43
if (numel(siz) > 1) && ~isequal(siz{:}) 
  44 
    error(message('MATLAB:strcat:InvalidInputSize'));
< 0.001 
    102 
  45
end 
  46 

< 0.001 
    102 
  47
s = cell([length(varargin) maxsiz]); 
< 0.001 
    102 
  48
for i = 1:length(varargin) 
  0.002 
    206 
  49
    s(i, :) = varargin{i}(:); 
< 0.001 
    206 
  50
end 
  51 

< 0.001 
    102 
  52
t = cell(maxsiz); 
< 0.001 
    102 
  53
for i = 1:prod(maxsiz) 
  0.001 
    102 
  54
    t{i} = [s{:, i}]; 
< 0.001 
    102 
  55
end 

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