maximum number and indexing
Afficher commentaires plus anciens
how can i find maximun number from an array for example .a=[2,44,6,77,3,9],how can i find max 2 numbers which are ,44 and 77 from a single command ? and how to know there index .thanks
Réponses (1)
madhan ravi
le 3 Avr 2019
maxk(a,2)
7 commentaires
asad jaffar
le 3 Avr 2019
madhan ravi
le 3 Avr 2019
Modifié(e) : madhan ravi
le 3 Avr 2019
[Values,Indices] = sort(a,'descend')
[Values(1:2);Indices(1:2)]
asad jaffar
le 3 Avr 2019
madhan ravi
le 3 Avr 2019
I have answered the question you originally asked.
asad jaffar
le 3 Avr 2019
Walter Roberson
le 3 Avr 2019
You should create a different Question for this.
Jan
le 5 Avr 2019
@asad: If madhan's answer solves your problem, be so kind to accept it.
Catégories
En savoir plus sur Point Cloud Processing dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!