MATLAB: How to filter out multiple rows based on another array

MATLAB

I have two arrays, a, b, one has numbers from 1,2, to 12. The other has 5 numbers 3,4, to 7. I want to filter out the rows in a that are not in b. How to do that? Thanks in advance.

Best Answer

result = a(ismember(a,b));