Finding the max of column 2 and column 3
2 次查看(过去 30 天)
显示 更早的评论
I have a matrix like
1 3 4
1 2 6
1 1 5
1 4 3
What I would like to do is to, for each row, take a max of column 2 and column 3. That is, the output will be like
1 3 4 4
1 2 6 6
1 1 5 5
1 4 3 4
I would like to know whether it is possible to do this calculation without writing a loop.
0 个评论
采纳的回答
madhan ravi
2020-7-24
[matrix, max(of second and third column of the matrix along rows)]
2 个评论
madhan ravi
2020-7-24
Did you take up the MATLAB On-ramp course? You seem to be asking the basic questions over and over again?
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!