extracting rows with the highest value
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Nathan
le 11 Sep 2022
Réponse apportée : Image Analyst
le 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
0 commentaires
Réponse acceptée
Torsten
le 11 Sep 2022
A = [1 3
4 6
2 5
8 1];
[~,imax] = max(A(:));
[irow,~] = ind2sub(size(A),imax(1))
A(irow,:)
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!