How to find the maximum number in each row in a variable.
1 次查看(过去 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?
0 个评论
采纳的回答
Walter Roberson
2013-1-24
max(YourArray, [], 2)
2 个评论
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 Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!