Effacer les filtres
Effacer les filtres

How to find maximum element of particular column in a array

1 vue (au cours des 30 derniers jours)
Ashutosh
Ashutosh le 7 Sep 2022
Commenté : Ashutosh le 7 Sep 2022
A=[1,2,3,4,5,18;7,8,9,16,11,12;13,14,15,10,17,6]
A = 3×6
1 2 3 4 5 18 7 8 9 16 11 12 13 14 15 10 17 6
Now I need maximum value of column 2,4 and 6
which is 14,16 and 18

Réponse acceptée

Walter Roberson
Walter Roberson le 7 Sep 2022
max(A(:, [2 4 6]),[],1)
The ,1 forces it to take maximum along columns even if there is only one row

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays 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!

Translated by