Extract 5 highest value of a vector

1 view (last 30 days)
If I want to extract the indices of the 5 highest value of a avg vector (30x1 for example) how can I do?
ind = find(avgDE... )

Accepted Answer

Andrei Bobrov
Andrei Bobrov on 26 Feb 2014
Edited: Andrei Bobrov on 26 Feb 2014
[a,ii] = sort(avgDE,'descend');
outidx = ii(1:5);

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!