Performance tips for a function which finds n maximums in a matrix

Or you adapt this one to get the maxima instead of minima, which is very efficient for small n.

1 Like