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

 채택된 답변

Torsten
Torsten 2022년 9월 11일
A = [1 3
4 6
2 5
8 1];
[~,imax] = max(A(:));
[irow,~] = ind2sub(size(A),imax(1))
irow = 4
A(irow,:)
ans = 1×2
8 1

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2022a

태그

질문:

2022년 9월 11일

답변:

2022년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by