This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
OC3function2
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
35
t = string(strcat(varargin{:})...
20.009 s79.6%
14
if isstring(varargin{idx})
60.001 s4.6%
15
mis = ismissing(varargin{idx})...
20.000 s3.2%
31
end
60.000 s3.1%
28
varargin{idx} = cellstr(vararg...
20.000 s2.4%
All other lines  0.001 s7.0%
Totals  0.011 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
cell.strcatfunction20.008 s71.1%
Self time (built-ins, overhead, etc.)  0.003 s28.9%
Totals  0.011 s100% 
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function49
Non-code lines (comments, blank lines)17
Code lines (lines that can run)32
Code lines that did run18
Code lines that did not run14
Coverage (did run/can run)56.25 %
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 string array,
   4 
%   returns a string array by concatenating corresponding elements
   5 
%   of S1,S2, etc.  The inputs must all have the same size
   6 
%   (or any can be a scalar).
   7 

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

  10 
    % Convert string arguments, replacing <missing> values.
< 0.001 
      2 
  11
    isScalarMissing = false; 
< 0.001 
      2 
  12
    isNonscalarMissing = false; 
< 0.001 
      2 
  13
    for idx = 1:numel(varargin) 
< 0.001 
      6 
  14
        if isstring(varargin{idx}) 
< 0.001 
      2 
  15
            mis = ismissing(varargin{idx}); 
< 0.001 
      2 
  16
            if any(mis(:)) 
  17 
                if isscalar(varargin{idx})
  18 
                    isScalarMissing = true;
  19 
                    varargin{idx} = '';
  20 
                else
  21 
                    isNonscalarMissing = true;
  22 
                    nonscalarMisIdx = mis;
  23 
                    str = varargin{idx};
  24 
                    str(nonscalarMisIdx) = '';
  25 
                    varargin{idx} = cellstr(str);
  26 
                end
< 0.001 
      2 
  27
            else 
< 0.001 
      2 
  28
                varargin{idx} = cellstr(varargin{idx}); 
< 0.001 
      2 
  29
            end 
< 0.001 
      6 
  30
        end 
< 0.001 
      6 
  31
    end 
  32 

  33 
    % Use the cell or char method of strcat, converting back to string.
< 0.001 
      2 
  34
    try 
  0.009 
      2 
  35
        t = string(strcat(varargin{:})); 
  36 
    catch e
  37 
        throw(e);
< 0.001 
      2 
  38
    end 
  39 

  40 
    % Restore <missing> values.
< 0.001 
      2 
  41
    if isScalarMissing 
  42 
        % Everything is missing.
  43 
        t(:) = missing;
< 0.001 
      2 
  44
    elseif isNonscalarMissing 
  45 
        % Entire value is missing.
  46 
        t(nonscalarMisIdx) = missing;
< 0.001 
      2 
  47
    end 
  48 

< 0.001 
      2 
  49
end 

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