|MATLAB Function Reference|
Compare the first
n characters of two strings
k = strncmp(' returns logical true (
1) if the first
n characters of the strings
str2 are the same, and returns logical false (
0) otherwise. Arguments
str2 may also be cell arrays of strings.
TF = strncmp(S,T,N)
T is a cell array of strings, returns an array
TF the same size as
1 for those elements of
T that match (up to
n characters), and
T must be the same size (or one can be a scalar cell). Either one can also be a character array with the right number of rows.
strncmp is case sensitive. Any leading and trailing blanks in either of the strings are explicitly included in the comparison.
strncmp is intended for comparison of character data. When used to compare numeric data,