MATLAB Answers

Maximum values of an matrix

6 views (last 30 days)
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.

  0 Comments

Sign in to comment.

Accepted Answer

madhan ravi
madhan ravi on 7 Aug 2019
Values=sort(A(:),'descend');
Values(2) % 2 - second max value

  0 Comments

Sign in to comment.

More Answers (1)

Ricardo Gutierrez
Ricardo Gutierrez on 7 Aug 2019
Thank you !!!

  0 Comments

Sign in to comment.

Products


Release

R2014a

Translated by