how to find the column number of a matrix?

조회 수: 3 (최근 30일)
Ishani Mahanama
Ishani Mahanama 2018년 11월 18일
댓글: madhan ravi 2018년 11월 18일
I have a simple question though I couldn´t find an answer for that. I have a matrix A= [ 3 4 , 6 7]
I want to find which column gets the maximum value from first raw elements and which column gets the maximum value from 2nd raw values. I know I can derive maximum value from this max(A(1, :)) . But I can´t find it´s column number. Thank you in advance.

채택된 답변

madhan ravi
madhan ravi 2018년 11월 18일
편집: madhan ravi 2018년 11월 18일
[value,index]=max(A(1,:))
By default the second output of max will give you the index you require.
  댓글 수: 2
Ishani Mahanama
Ishani Mahanama 2018년 11월 18일
thank you
madhan ravi
madhan ravi 2018년 11월 18일
Anytime :)

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by