F = ismember(x,[1 2 3 4]);
Of course, this can also be obtained with a standard integer variable
F = [1 <= x <=4];
or an integrality constraint.
F = [integer(x), 1 <= x <= 4];
The functionality is more useful when the set is more complicated.
F = ismember(x,[1 pi 12 -8]);
The function can also be used together with the polytope object in MPT to constrain a variable to be inside at least one of several polytopes.
P1 = polytope(randn(10,3),rand(10,1));
P2 = polytope(randn(10,3),rand(10,1));
F = ismember(x,[P1 P2]);
Note that ismember will introduce binary variables if the cardinality of the set Y is larger than 1