MATLAB: How to extract a certain row out of a matrix

rows

Hello
How can I extract a certain rows out of a matrix ? for example:
a=[2 2;2 2;2 2;1 1;0 1;0 1;0 1]
I want to extract row [0 1] out a matrix a and have a new matrix b :
b=[0 1;0 1;0 1]
Thank you

Best Answer

ind=ismember(a,[0 1],'rows');
b=a(ind,:)