using maxk with named columns

2 ビュー (過去 30 日間)
Rick Huisman
Rick Huisman 2020 年 10 月 9 日
コメント済み: Ameer Hamza 2020 年 10 月 9 日
I want to locate the maximum number in a matrix.
For instance
A = magic(5)
to show the highest value I use maxk(A,1)
when I assign variable names to the table, maxk doesnt work, probably because there are now also names in the table.
How do I get this to work?

採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 9 日
編集済み: Ameer Hamza 2020 年 10 月 9 日
If all the columns in the table are numeric
max_val = max(T{:,:})
Note maxk(x,1) is same as max(k).
  2 件のコメント
Rick Huisman
Rick Huisman 2020 年 10 月 9 日
Thank you :)
Ameer Hamza
Ameer Hamza 2020 年 10 月 9 日
I am glad to be of help!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by