| MATLAB Function Reference | ![]() |
x = strmatch(str, strarray)
x = strmatch(str, strarray, 'exact')
x = strmatch(str, strarray) looks through the rows of the character array or cell array of strings strarray to find strings that begin with the text contained in str, and returns the matching row indices. Any trailing space characters in str or strarray are ignored when matching. strmatch is fastest when strarray is a character array.
x = strmatch(str, strarray, 'exact') compares str with each row of strarray, looking for an exact match of the entire strings. Any trailing space characters in str or strarray are ignored when matching.
The statement
x = strmatch('max', strvcat('max', 'minimax', 'maximum'))returns x = [1; 3] since rows 1 and 3 begin with 'max'. The statement
x = strmatch('max', strvcat('max', 'minimax', 'maximum'),'exact')returns x = 1, since only row 1 matches 'max' exactly.
strcmp, strcmpi, strncmp, strncmpi, strfind, findstr, strvcat, regexp, regexpi, regexprep
![]() | strjust | strncmp, strncmpi | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |