Find top n elements in matrix

前端 未结 3 1347
春和景丽
春和景丽 2021-01-26 16:39

I have a matrix which contains values and I wish to find the index of the top n minimum values.

I use the following code for finding the minimum most value:

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-26 17:41

    Or without Intersect in the other answer

    [sorted,I] = sort(Result(:));
    [r,c] = ind2sub(size(Result),I(1:10));  %//Change 10 to any other required value
    

提交回复
热议问题