MATLAB Function Reference Previous page   Next Page
strmatch

Find possible matches for string

Syntax

Description

x = strmatch('str', STRS) looks through the rows of the character array or cell array of strings STRS to find strings that begin with string str, returning the matching row indices. strmatch is fastest when STRS is a character array.

x = strmatch('str', STRS, 'exact') returns only the indices of the strings in STRS matching str exactly.

Examples

The statement

returns x = [1; 3] since rows 1 and 3 begin with 'max'. The statement

returns x = 1, since only row 1 matches 'max' exactly.

See Also

strcmp, strcmpi, strncmp, strncmpi, strfind, findstr, strvcat, regexp, regexpi, regexprep


Previous page  strjust strncmp Next page

© 1994-2005 The MathWorks, Inc.