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!