How to select the indexes of maximum 3 values in the array without sorting?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
navya
le 20 Mar 2014
Commenté : Walter Roberson
le 20 Mar 2014
Find the index of the largest 3 elements?
0 commentaires
Réponse acceptée
Walter Roberson
le 20 Mar 2014
"for" loop.
2 commentaires
Walter Roberson
le 20 Mar 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.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!