MATLAB Function Reference    
ismember

Detect members of a set

Syntax

Description

k = ismember(a,S) returns an vector the same length as a containing logical true (1) where the elements of a are in the set S, and logical false (0) elsewhere. In set theoretic terms, k is 1 where a S. a and S can be cell arrays of strings.

k = ismember(A,S,'rows') when A and S are matrices with the same number of columns returns a vector containing 1 where the rows of A are also rows of S and 0 otherwise.

Examples

See Also

intersect, setdiff, setxor, union, unique, is*


 iskeyword isocaps