How to calculate argument max for a vector

10 ビュー (過去 30 日間)
Hazim Nasir
Hazim Nasir 2018 年 8 月 9 日
コメント済み: Hazim Nasir 2018 年 8 月 9 日
Hello, How I can calculate arg max for the following vector
p=[0.0061,0.0188,0.0014,0.0233,Inf,0.0130,0.0016,0.0155,0.0016,0.002,0.002,0.0032,0.0054]

採用された回答

James Tursa
James Tursa 2018 年 8 月 9 日
編集済み: James Tursa 2018 年 8 月 9 日
Assuming "arg max" means index of the max location, use both outputs of the max function
p = your vector
[m,x] = max(p);
m will contain the max, x will contain the index location of the max (first one)
  1 件のコメント
Hazim Nasir
Hazim Nasir 2018 年 8 月 9 日
thank you for your answer

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by