How to select the indexes of maximum 3 values in the array without sorting?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
navya
am 20 Mär. 2014
Kommentiert: Walter Roberson
am 20 Mär. 2014
Find the index of the largest 3 elements?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 20 Mär. 2014
"for" loop.
2 Kommentare
Walter Roberson
am 20 Mär. 2014
for K = 1 : length(x)
if x(K) > 5
disp(K)
end
end
the above example does not try to find any maximums, it just shows how you can create a loop that examines values in the array and does something conditionally.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!