This is a static copy of a profile report

Home

stringToLegacyText (Calls: 90, Time: 0.001 s)
Generated 16-Jul-2020 17:09:37 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/datatypes/shared/matlab_datatypes/+matlab/+internal/+datatypes/stringToLegacyText.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
datestrfunction40
datenumfunction40
datevecfunction10
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
28
end
900.000 s4.5%
14
if isstring(s)
900.000 s1.5%
All other lines  0.001 s94.0%
Totals  0.001 s100% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function28
Non-code lines (comments, blank lines)16
Code lines (lines that can run)12
Code lines that did run2
Code lines that did not run10
Coverage (did run/can run)16.67 %
Function listing
time 
Calls 
 line
   1 
function s = stringToLegacyText(s,scalarCellOutput)
   2 
%STRINGTOLEGACYTEXT Convert string array to char or cellstr.
   3 
%    S = STRINGTOLEGACYTEXT(S) converts the string array S to a char row vector,
   4 
%    if S is a scalar, or to a cellstr, if S is not a scalar. If S is not a
   5 
%    string array, it is returned as is. Missing strings are converted into the
   6 
%    empty character vector, ''.
   7 
%
   8 
%    S = STRINGTOLEGACYTEXT(S,TRUE) always converts a string array S to cellstr,
   9 
%    even if S is a scalar. If S is a char row vector, STRINGTOLEGACYTEXT(S,TRUE)
  10 
%    does not convert it to a scalar cellstr.
  11 

  12 
%   Copyright 2017 The MathWorks, Inc.
  13 

< 0.001 
     90 
  14
if isstring(s) 
  15 
    % Convert missing string to empty string so that they can be converted into
  16 
    % empty character vectors.
  17 
    s(ismissing(s)) = "";
  18 
    
  19 
    if isscalar(s)
  20 
        if nargin < 2 || ~scalarCellOutput
  21 
            s = char(s);
  22 
        else
  23 
            s = cellstr(s);
  24 
        end
  25 
    else % cellstr instead of character matrix
  26 
        s = cellstr(s);
  27 
    end
< 0.001 
     90 
  28
end 

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