I am looking for a function to find the most repeated (i.e. modal) rows of a matrix in MATLAB. Something like:
>> A = [0, 1; 2, 3; 0, 1; 3, 4]
A =
0 1
2 3
0 1
3 4
Then running:
>> mode(A, 'rows')
would return [0, 1]
, ideally with a second output giving the indexes where this row occurred (i.e. [1, 3]'
.)
Does anyone know of such a function?