extracting rows with the highest value

10 ビュー (過去 30 日間)
Nathan
Nathan 2022 年 9 月 11 日
回答済み: Image Analyst 2022 年 9 月 11 日
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

その他の回答 (1 件)

Image Analyst
Image Analyst 2022 年 9 月 11 日

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by