⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strtok.m

📁 M2HTML by itself generates an HTML documentation of Matlab M-files in the current directory.
💻 M
字号:
function [token, remainder, quotient] = strtok(string, delimiters)%Modified version of STRTOK to also return the quotient%  string = [quotient token remainder]%STRTOK Find token in string.%   STRTOK(S) returns the first token in the string S delimited%   by "white space".   Any leading white space characters are ignored.%%   STRTOK(S,D) returns the first token delimited by one of the %   characters in D.  Any leading delimiter characters are ignored.%%   [T,R] = STRTOK(...) also returns the remainder of the original%   string.%   If the token is not found in S then R is an empty string and T%   is same as S. %%   Copyright 1984-2002 The MathWorks, Inc. %   $Revision: 5.14 $  $Date: 2002/04/09 00:33:38 $token = []; remainder = []; quotient = string;len = length(string);if len == 0    returnendif (nargin == 1)    delimiters = [9:13 32]; % White space charactersendi = 1;while (any(string(i) == delimiters))    i = i + 1;    if (i > len), return, endendstart = i;while (~any(string(i) == delimiters))    i = i + 1;    if (i > len), break, endendfinish = i - 1;token = string(start:finish);if (nargout >= 2)    remainder = string(finish + 1:length(string));endif (nargout == 3 & start > 1)	quotient = string(1:start-1);else	quotient = [];end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -