Maximum values of an matrix

1 回表示 (過去 30 日間)
Ricardo Gutierrez
Ricardo Gutierrez 2019 年 8 月 7 日
回答済み: Ricardo Gutierrez 2019 年 8 月 7 日
Hello good day.
I have a matrix A = [64 79 91; 87 29 31; 59 17 43]
the first maximum value of that matrix A is 91 and I get that value from
M1 = max(max (A)) = 91
How do I get the second maximum value? that is 87
I hope you can help me.
Thanks and regards.

採用された回答

madhan ravi
madhan ravi 2019 年 8 月 7 日
Values=sort(A(:),'descend');
Values(2) % 2 - second max value

その他の回答 (1 件)

Ricardo Gutierrez
Ricardo Gutierrez 2019 年 8 月 7 日
Thank you !!!

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by