How to find maximum element of particular column in a array
조회 수: 4 (최근 30일)
이전 댓글 표시
A=[1,2,3,4,5,18;7,8,9,16,11,12;13,14,15,10,17,6]
Now I need maximum value of column 2,4 and 6
which is 14,16 and 18
채택된 답변
Walter Roberson
2022년 9월 7일
max(A(:, [2 4 6]),[],1)
The ,1 forces it to take maximum along columns even if there is only one row
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!