maximum number and indexing
显示 更早的评论
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
回答(1 个)
madhan ravi
2019-4-3
maxk(a,2)
7 个评论
asad jaffar
2019-4-3
madhan ravi
2019-4-3
编辑:madhan ravi
2019-4-3
[Values,Indices] = sort(a,'descend')
[Values(1:2);Indices(1:2)]
asad jaffar
2019-4-3
madhan ravi
2019-4-3
I have answered the question you originally asked.
asad jaffar
2019-4-3
Walter Roberson
2019-4-3
You should create a different Question for this.
Jan
2019-4-5
@asad: If madhan's answer solves your problem, be so kind to accept it.
类别
在 帮助中心 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!