This is a static copy of a profile report

Home

partialMatchString (Calls: 20, Time: 0.003 s)
Generated 16-Jul-2020 17:09:34 using performance time.
function in file /Applications/MATLAB_R2020a.app/toolbox/matlab/ops/+matlab/+internal/+math/partialMatchString.m
Copy to new window for comparing multiple runs

Parents (calling functions)

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

Line NumberCodeCallsTotal Time% TimeTime Plot
18
tf = strncmpi(str, options, ma...
200.002 s64.7%
15
if ~((ischar(str) && i...
200.000 s9.5%
10
assert(isstring(options) || is...
200.000 s7.2%
6
if nargin < 3
200.000 s6.6%
20
tf = tf & (nnz(tf) == 1);
200.000 s0.9%
All other lines  0.000 s11.1%
Totals  0.003 s100% 
Children (called functions)

Function NameFunction TypeCallsTotal Time% TimeTime Plot
strlengthfunction200.001 s28.1%
Self time (built-ins, overhead, etc.)  0.002 s71.9%
Totals  0.003 s100% 
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 
     20 
   6
    if nargin < 3 
< 0.001 
     20 
   7
        N = 1; 
< 0.001 
     20 
   8
    end 
   9 
    % Possible options to match should be string/char/cellstr
< 0.001 
     20 
  10
    assert(isstring(options) || ischar(options) || iscellstr(options)) 
< 0.001 
     20 
  11
    if ~isstring(options) 
  12 
        options = string(options);
< 0.001 
     20 
  13
    end 
  14 
    % String to match must be scalar text
< 0.001 
     20 
  15
    if ~((ischar(str) && isrow(str)) || (isstring(str) && isscalar(str))) 
  16 
        tf = false(size(options));
< 0.001 
     20 
  17
    else 
  0.002 
     20 
  18
        tf = strncmpi(str, options, max(N, strlength(str))); 
  19 
        % No duplicate matches
< 0.001 
     20 
  20
        tf = tf & (nnz(tf) == 1); 
< 0.001 
     20 
  21
    end 
< 0.001 
     20 
  22
end 

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