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

2 次查看(过去 30 天)
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?

采纳的回答

Walter Roberson
Walter Roberson 2013-1-24
max(YourArray, [], 2)
  2 个评论
Bethelhem Biru
Bethelhem Biru 2020-12-10
this will sisplay as a column matrix, if you want it to display as a row matrix, use the ' sign, for transposition. :)

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by