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 CenterFile Exchange에서 Get 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