How to find the maximum number in each row in a variable.

1 visualizzazione (ultimi 30 giorni)
Lets say I have the following matrix:
1 2 3 4 5
2 3 3 3 3
2 2 2 2 5
how should I use max to get the larget number per row?

Risposta accettata

Walter Roberson
Walter Roberson il 24 Gen 2013
max(YourArray, [], 2)
  2 Commenti
Bethelhem Biru
Bethelhem Biru il 10 Dic 2020
this will sisplay as a column matrix, if you want it to display as a row matrix, use the ' sign, for transposition. :)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by