MATLAB: Matching unequal arrays

unequal arrays matching ...

Hi; I want to match the values of unequal arrays for a case as
m=(1:6); n=[1 2 5];
output=(0 0 1 1 0 1)
that is if an element of n is in m then the value in output is zero else 1.
Any hints?

Best Answer

output = ~ismember(m,n)