This is a static copy of a profile report

Home

strtok (1 call, 0.000 sec)
Generated 04-Aug-2014 13:05:17 using cpu time.
function in file /share/apps/matlabr2014a/toolbox/matlab/strfun/strtok.m
Copy to new window for comparing multiple runs

Parents (calling functions)

Function NameFunction TypeCalls
Bottom_Gravity_Current_Setup6script1
Lines where the most time was spent
No measurable time spent in this function

Line NumberCodeCallsTotal Time% TimeTime Plot
71
end
10 s0%
70
remainder = string(finish + 1:...
10 s0%
69
if (nargout == 2)
10 s0%
67
token = string(start:finish);
10 s0%
65
finish = i - 1;
10 s0%
All other lines  0 s0%
Totals  0 s0% 
Children (called functions)
No children
Code Analyzer results
No Code Analyzer messages.
Coverage results
Show coverage for parent directory
Total lines in function71
Non-code lines (comments, blank lines)41
Code lines (lines that can run)30
Code lines that did run19
Code lines that did not run11
Coverage (did run/can run)63.33 %
Function listing
time 
calls 
 line
   1 
function [token, remainder] = strtok(string, delimiters)
   2 
%STRTOK Find token in string.
   3 
%   TOKEN = STRTOK(STR) returns the first token in the string STR delimited
   4 
%   by white-space characters. STRTOK ignores any leading white space. 
   5 
%   If STR is a cell array of strings, TOKEN is a cell array of tokens.
   6 
%
   7 
%   TOKEN = STRTOK(STR,DELIM) returns the first token delimited by one of  
   8 
%   the characters in DELIM. STRTOK ignores any leading delimiters.
   9 
%   Do not use escape sequences as delimiters.  For example, use char(9)
  10 
%   rather than '\t' for tab.
  11 
%
  12 
%   [TOKEN,REMAIN] = STRTOK(...) returns the remainder of the original
  13 
%   string.
  14 
%
  15 
%   If the body of the input string does not contain any delimiter 
  16 
%   characters, STRTOK returns the entire string in TOKEN (excluding any
  17 
%   leading delimiter characters), and REMAIN contains an empty string.
  18 
%
  19 
%   Example:
  20 
%
  21 
%      s = '  This is a simple example.';
  22 
%      [token, remain] = strtok(s)
  23 
%
  24 
%   returns
  25 
%
  26 
%      token = 
  27 
%      This
  28 
%      remain = 
  29 
%       is a simple example.
  30 
%
  31 
%   See also ISSPACE, STRFIND, STRNCMP, STRCMP, TEXTSCAN.
  32 

  33 
%   Copyright 1984-2009 The MathWorks, Inc.
  34 

      1 
  35 
if nargin<1  
  36 
   error(message('MATLAB:strtok:NrInputArguments'));
  37 
end
  38 

      1 
  39 
token = ''; remainder = ''; 
  40 

      1 
  41 
len = length(string); 
      1 
  42 
if len == 0 
  43 
    return
  44 
end
  45 

      1 
  46 
if (nargin == 1) 
      1 
  47 
    delimiters = [9:13 32]; % White space characters 
      1 
  48 
end 
  49 

      1 
  50 
i = 1; 
      1 
  51 
while (any(string(i) == delimiters)) 
  52 
    i = i + 1;
  53 
    if (i > len), 
  54 
       return, 
  55 
    end
  56 
end
  57 

      1 
  58 
start = i; 
      1 
  59 
while (~any(string(i) == delimiters)) 
     11 
  60 
    i = i + 1; 
     11 
  61 
    if (i > len),  
  62 
       break, 
  63 
    end
     11 
  64 
end 
      1 
  65 
finish = i - 1; 
  66 

      1 
  67 
token = string(start:finish); 
  68 

      1 
  69 
if (nargout == 2) 
      1 
  70 
    remainder = string(finish + 1:length(string)); 
      1 
  71 
end