This is a static copy of a profile report

Home

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

Parents (calling functions)

Function NameFunction TypeCalls
tabular.matchPropertyNamefunction8
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
21
tf = (isrow(txt) || isequal(tx...
80.000 s27.7%
19
if nargin < 2 || allowEmpty...
80.000 s18.2%
20
if ischar(txt)
80.000 s12.3%
35
end
80.000 s0.8%
26
end
80.000 s0.2%
All other lines  0.000 s40.8%
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 function35
Non-code lines (comments, blank lines)18
Code lines (lines that can run)17
Code lines that did run5
Code lines that did not run12
Coverage (did run/can run)29.41 %
Function listing
time 
Calls 
 line
   1 
function tf = isScalarText(txt,allowEmptyOrMissing)
   2 
%ISSCALARTEXT True for a scalar text value
   3 
%   TF = ISSCALARTEXT(TXT) returns true if TXT is a scalar text value, i.e.
   4 
%      * a scalar string
   5 
%      * a 1xN character vector
   6 
%      * the 0x0 char array ''
   7 
%
   8 
%   TF = ISSCALARTEXT(TXT,FALSE) returns true only if TXT is a non-empty,
   9 
%   non-missing text value, i.e.
  10 
%      * a scalar string not equal to "", all whitespace, or <missing>
  11 
%      * a 1xN character vector for N > 0, not all whitespace
  12 
%   
  13 
%   Note that ISSCALARTEXT returns FALSE for a scalar cellstr.
  14 
%
  15 
%   See also MATLAB.INTERNAL.DATATYPES.ISTEXT, ISSPACE, STRINGS.
  16 

  17 
%   Copyright 2017 The MathWorks, Inc.
  18 

< 0.001 
      8 
  19
if nargin < 2 || allowEmptyOrMissing % allow empty or missing 
< 0.001 
      8 
  20
    if ischar(txt) 
< 0.001 
      8 
  21
        tf = (isrow(txt) || isequal(txt,'')); % empty and missing same for char 
  22 
    elseif isstring(txt)
  23 
        tf = isscalar(txt);
  24 
    else
  25 
        tf = false;
< 0.001 
      8 
  26
    end 
  27 
else % do not allow empty or missing
  28 
    if ischar(txt)
  29 
        tf = isrow(txt) && ~all(isspace(txt)); % ~all(isspace(txt)) catches 1x0
  30 
    elseif isstring(txt)
  31 
        tf = isscalar(txt) && ~ismissing(txt) && ~all(isspace(txt));
  32 
    else
  33 
        tf = false;
  34 
    end
< 0.001 
      8 
  35
end 

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