extracting rows with the highest value

3 Ansichten (letzte 30 Tage)
Nathan
Nathan am 11 Sep. 2022
Beantwortet: Image Analyst am 11 Sep. 2022
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

Akzeptierte Antwort

Torsten
Torsten am 11 Sep. 2022
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

Weitere Antworten (1)

Image Analyst
Image Analyst am 11 Sep. 2022

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by