MATLAB: Finding matched rows of matrix with other matrix

MATLAB

Lets say we have two matrix.
A=[1 1]
B=[2 0;1 1;1 1;3 1]
Now second and third rows of B are same as matrix A. and I want to find indices of such rows. i.e 2 and 3
I have tried 'ismember' but it is giving just first matched row index i.e. 2 (code can be seen below)
Thanks
A=[1 1]
B=[2 0;1 1;1 1;3 1]
[L, M] = ismember(A,B, 'rows')

Best Answer

arr=[];
for i=1:size(B,1)
c=0;
for j=1:2
if B(i,j)==A(1,j)
c=c+1;
end
end
if c==2
arr=[arr i]
end
end
arr gives your required indices