how to find the column number of a matrix?

3 ビュー (過去 30 日間)
Ishani Mahanama
Ishani Mahanama 2018 年 11 月 18 日
コメント済み: madhan ravi 2018 年 11 月 18 日
I have a simple question though I couldn´t find an answer for that. I have a matrix A= [ 3 4 , 6 7]
I want to find which column gets the maximum value from first raw elements and which column gets the maximum value from 2nd raw values. I know I can derive maximum value from this max(A(1, :)) . But I can´t find it´s column number. Thank you in advance.

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 18 日
編集済み: madhan ravi 2018 年 11 月 18 日
[value,index]=max(A(1,:))
By default the second output of max will give you the index you require.
  2 件のコメント
Ishani Mahanama
Ishani Mahanama 2018 年 11 月 18 日
thank you
madhan ravi
madhan ravi 2018 年 11 月 18 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFile Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by