how to display in one variable the max of each one of two arrays?
1 次查看(过去 30 天)
显示 更早的评论
a=[5 10 15]
b=[20 25 30]
c= ?
0 个评论
采纳的回答
更多回答(1 个)
Star Strider
2016-9-17
Concatenate the vectors inside the max function call:
a = [5 10 15];
b = [20 25 30];
c = max([a; b], [], 2)
c =
15
30
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!