필터 지우기
필터 지우기

finding the N highest values in a vector

조회 수: 1 (최근 30일)
fafz1203
fafz1203 2016년 10월 20일
편집: Matt J 2016년 10월 20일
i have a vector matrix with a (1*10,000) dimension. I want to find the 10 highest values from this matrix with their respective indices. I can't use sorting because I will lose the original indices of the numbers after sorting. Can anyone help?
Let me know if you have any questions.

답변 (1개)

Matt J
Matt J 2016년 10월 20일
편집: Matt J 2016년 10월 20일
I can't use sorting because I will lose the original indices of the numbers after sorting.
You needn't lose them because [A,J]=SORT(...) will give you the original indices in J. Nevertheless, a more efficient approach than sorting would be to use this FEX subsmission,

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by