Suppose I have the following matrix:
01 02 03 06 03 05 07 02 13 10 11 12 32 01 08 03
And I want the indices of the top 5 elements (in this
In MATLAB ≥ R2017b, you can use maxk for this specific purpose.
[maxvalues, ind] = maxk(A(:), 5);