How can I arrange an array in an ascending way?
1 次查看(过去 30 天)
显示 更早的评论
Hello MATLAB users,
If there are two arrays: a=[5 8 14 15 17 19 22 23 26 31 34 35 36 39]; and b=[25 30 34 42];, how can I create an array c including the mixture of a and b but arranged in an ascending way?
Thanks so much, Mehdi
0 个评论
采纳的回答
Wayne King
2011-12-16
Hi, if they are row vectors as you have indicated
c = sort([a b],'ascend');
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!