Mixing and merge two vectors

23 次查看(过去 30 天)
Dear all, i want to mix and merge two vector in a one,
A = [1 2 3 4];
B = [5 6 7 8];
to get
C = [1 5 2 6 3 7 4 8];
Thanks in advance

采纳的回答

Star Strider
Star Strider 2017-5-23
This works:
A = [1 2 3 4];
B = [5 6 7 8];
C = reshape([A; B], [], 1)';
C =
1 5 2 6 3 7 4 8

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Types 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by