Filter löschen
Filter löschen

finding the N highest values in a vector

1 Ansicht (letzte 30 Tage)
fafz1203
fafz1203 am 20 Okt. 2016
Bearbeitet: Matt J am 20 Okt. 2016
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.

Antworten (1)

Matt J
Matt J am 20 Okt. 2016
Bearbeitet: Matt J am 20 Okt. 2016
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,

Kategorien

Mehr zu Shifting and Sorting Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by