how we can select 2 or more variables from an array depending on their values.
2 views (last 30 days)
Show older comments
like i have an array of say 100 variables.i want to select 4 variables from this array whose values are maximum in that array.what kind of command is available rather than max in matlab?
Accepted Answer
Andrei Bobrov
on 27 Nov 2013
Edited: Andrei Bobrov
on 27 Nov 2013
[value1,index1] = sort(A,'descend');
out = [value1(1:4),index1(1:4)];
0 Comments
More Answers (1)
See Also
Categories
Find more on Line Plots 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!