Clear Filters
Clear Filters

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

2 views (last 30 days)
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?

Accepted Answer

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

Sign in to comment.

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!