Given an array
X I would like to find the
n maximum (or minimum) values of the array and the positions where they are located. In matlab there is the following function that just does this
findmax that already does this for the maximum value. Could we have it for n values?
findmax(X,5) returning 5 values and 5 positions would be very nice.