I have a matrix which contains values and I wish to find the index of the top n minimum values.
n
I use the following code for finding the minimum most value:
Maybe you could do something like this:
sorted = sort(Result(:)); topten = sorted(1:10); [~,ia,~] = intersect(Result(:),topten(:)); % // Get the indices of the top ten values [r,c]=ind2sub(size(Result),ia); % // Convert the indices to rows and columns