找出相同的行的函数!
请问如何在一个矩阵中将所有相同的行找出来!有没有现成得函数呢?
Now, I can give a solution.
for matrix A=[1 2; 2 3; 1 2], the following function can be used to find the same row in the matrix A.
function result=find_same_row(A)
[rowA,colA]=size(A);
B=unique(A,'rows');
[rowB,colB]=size(B);
for i=1:rowB
temp=B(i,:);
result=find((min((A==temp(ones(1,rowA),:)),[],2))');
end