This is a static copy of a profile report

Home

partialMatchString (Calls: 8, Time: 0.001 s)
Generated 04-Jun-2021 04:11:21 using performance time.
function in file C:\Program Files\MATLAB\R2020b\toolbox\matlab\ops\+matlab\+internal\+math\partialMatchString.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
ismemberfunction4
cell.uniquefunction4
Lines where the most time was spent

Line NumberCodeCallsTotal Time% TimeTime Plot
18
tf = strncmpi(str, options, ma...
80.000 s41.5%
15
if ~((ischar(str) && i...
80.000 s16.1%
10
assert(isstring(options) || is...
80.000 s13.6%
6
if nargin < 3
80.000 s10.2%
20
tf = tf & (nnz(tf) == 1);
80.000 s0.8%
All other lines  0.000 s17.9%
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 function22
Non-code lines (comments, blank lines)8
Code lines (lines that can run)14
Code lines that did run12
Code lines that did not run2
Coverage (did run/can run)85.71 %
Function listing
time 
Calls 
 line
   1 
function tf = partialMatchString(str, options, N)
   2 
% PARTIALMATCHSTRING  Partial matching for string options.
   3 

   4 
%   Copyright 2017 The MathWorks, Inc.
   5 

< 0.001 
      8 
   6
    if nargin < 3 
< 0.001 
      8 
   7
        N = 1; 
< 0.001 
      8 
   8
    end 
   9 
    % Possible options to match should be string/char/cellstr
< 0.001 
      8 
  10
    assert(isstring(options) || ischar(options) || iscellstr(options)) 
< 0.001 
      8 
  11
    if ~isstring(options) 
  12 
        options = string(options);
< 0.001 
      8 
  13
    end 
  14 
    % String to match must be scalar text
< 0.001 
      8 
  15
    if ~((ischar(str) && isrow(str)) || (isstring(str) && isscalar(str))) 
  16 
        tf = false(size(options));
< 0.001 
      8 
  17
    else 
< 0.001 
      8 
  18
        tf = strncmpi(str, options, max(N, strlength(str))); 
  19 
        % No duplicate matches
< 0.001 
      8 
  20
        tf = tf & (nnz(tf) == 1); 
< 0.001 
      8 
  21
    end 
< 0.001 
      8 
  22
end 

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