function ismember - set operations:
The function ismember receives two vectors as input arguments, and returns a logical vector which is of similar length as the first argument, having 1 for true when the element in the first vector is also in the second, or 0 for false when not.
The order of arguments matters for this function.
2 3 4 5 6
1 3 5 7
0 1 0 1 0
0 1 1 0
By using the answer from the ismember function as an index into the first vector argument will return similar result as the intersect function.
>> logv = ismember(v1,v2)
>> logv = ismember(v2,v1)