This is a static copy of a profile report

Home

isScalarText (Calls: 18, Time: 0.000 s)
Generated 04-Jun-2021 04:11:11 using performance time.
function in file C:\Program Files\MATLAB\R2020b\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.matchPropertyNamefunction18
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
19
if nargin < 2 || allowEmpty...
180.000 s40.1%
21
tf = (isrow(txt) || isequal(tx...
180.000 s18.4%
20
if ischar(txt)
180.000 s8.8%
35
end
180.000 s1.2%
26
end
180.000 s0.2%
All other lines  0.000 s31.2%
Totals  0.000 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 
     18 
  19
if nargin < 2 || allowEmptyOrMissing % allow empty or missing 
< 0.001 
     18 
  20
    if ischar(txt) 
< 0.001 
     18 
  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 
     18 
  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 
     18 
  35
end 

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