Filter löschen
Filter löschen

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

2 Ansichten (letzte 30 Tage)
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Jan. 2013
max(YourArray, [], 2)
  2 Kommentare
Lester Lim
Lester Lim am 24 Jan. 2013
Yup, it works! thanks!
Bethelhem Biru
Bethelhem Biru am 10 Dez. 2020
this will sisplay as a column matrix, if you want it to display as a row matrix, use the ' sign, for transposition. :)

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by