MATLAB: How to compare a single row with remaining all rows of a matrix

homeworkMATLABno attempt

my input matrix is v=[1 2 3 4 5;3 4 7 8 9;6 4 8 7 9;3 4 7 8 9;3 2 9 8 4]; I am taking second row alone. I have to compare it with all the remaining rows. How to do it. Suggest me simple code which has few lines.

Best Answer

out = ismember(v,v(2,:),'rows');