I have a NxM matrix and I want to find the rows that have M-1 duplicate entries. For example:
A=[1 1 2 4; 2 2 2 1; 2 9 3 0; 3 0 3 3; 4 3 2 2];fun(A);ans = [2 2 2 1; 3 0 3 3]
How could I do this, preferably elegantly in a few lines? I am trying to avoid loops because I anticipate working with large matrices eventually.
Best Answer