MATLAB: Function opposite of ismember

ismember

Hi, Is there a function that does the opposite of 'ismember' i.e. something like, 'isnotmember'?
So if:
A = [1:10]
B = [2,5,7]
ismember(A,B)
ans =
0 1 0 0 1 0 1 0 0 0
But instead, I want
isnotmember(A,B)
ans =
1 0 1 1 0 1 0 1 1 1

Best Answer

Use the logical negation symbol
~ismember(A,B)
or the functional form:
not(ismember(A,B))