How to combine two arrays

3 次查看(过去 30 天)
MIch
MIch 2022-9-30
评论: MIch 2022-9-30
Hello,
for example there are a= [3 5 1] and b = [4 6 7]
How can I combine a and b to get c= [3 4 5 6 1 7]?

采纳的回答

Robert U
Robert U 2022-9-30
Hi MIch,
have a look in the documentation under language fundamentals --> reshape()
a = [3 5 1];
b = [4 6 7];
c= reshape([a' b']',1,[])
c = 1×6
3 4 5 6 1 7
Kind regars,
Robert

更多回答(1 个)

zhehao.nkd
zhehao.nkd 2022-9-30
Try reshape([a;b],1,[])

类别

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

标签

Community Treasure Hunt

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

Start Hunting!

Translated by