Maximum values of an matrix

1 次查看(过去 30 天)
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
Thank you !!!

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

产品


版本

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by