extracting rows with the highest value
조회 수: 3 (최근 30일)
이전 댓글 표시
I want to extract a row that has the highest value in one of the columns for example:
1 3
4 6
2 5
8 1
I would want to extract the row of 8 1
댓글 수: 0
채택된 답변
Torsten
2022년 9월 11일
A = [1 3
4 6
2 5
8 1];
[~,imax] = max(A(:));
[irow,~] = ind2sub(size(A),imax(1))
A(irow,:)
댓글 수: 0
추가 답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!