MATLAB: How to compare two lists

compare

i have two lists lets say a=[1 2 3 ] and b =[1 2 3 4 5 ] and i want to compare each element of ' a ' with all elements of "b" it means that 1 is compared with whole list "b" then 2 is compared then 3 and if the element of "a" is member of "b" then output "a"else 0.

Best Answer

a .* ismember(a, b)