필터 지우기
필터 지우기

How to find the maximum number in each row in a variable.

조회 수: 2 (최근 30일)
Lester Lim
Lester Lim 2013년 1월 24일
댓글: Bethelhem Biru 2020년 12월 10일
Lets say I have the following matrix:
1 2 3 4 5
2 3 3 3 3
2 2 2 2 5
how should I use max to get the larget number per row?

채택된 답변

Walter Roberson
Walter Roberson 2013년 1월 24일
max(YourArray, [], 2)
  댓글 수: 2
Lester Lim
Lester Lim 2013년 1월 24일
Yup, it works! thanks!
Bethelhem Biru
Bethelhem Biru 2020년 12월 10일
this will sisplay as a column matrix, if you want it to display as a row matrix, use the ' sign, for transposition. :)

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by