I have an n-by-m rectangular matrix (n != m). What\'s the best way to find out if there are any duplicate rows in it in MATLAB? What\'s the best way to find the indices of t
Say your matrix is M:
[S,idx1] = sortrows(M); idx2 = find(all(diff(S,1) == 0,2)); out = unique(idx1([idx2;idx2+1]));
out will contain the duplicate row indices if any.