How to append vectors end to end???

281 次查看(过去 30 天)
Hi, I have two vectors and wanted to join these vectors end to end. The output i wanted is,
[c]=
1 2 3 4 5 6 7 8 9 10 11 12 13 14
but when i run the code,
e.g.
[a] = [1 2 3 4 5 6 7] ;
[b] = [8 9 10 11 12 13 14];
[c] = [a ; b];
output::
[c] =
1 2 3 4 5 6 7
8 9 10 11 12 13 14
How would I do this? Thanks for your help.
  3 个评论
Stephen23
Stephen23 2018-5-3
Basic MATLAB concepts, such as how to create and concatenate arrays, are covered in the introductory tutorials (which are highly recommended for all beginners):
Ihtisham Khan
Ihtisham Khan 2018-5-3
thanks Stephen Cobeldick and Dennis

请先登录,再进行评论。

采纳的回答

Ameer Hamza
Ameer Hamza 2018-5-3
See cat().
out = cat(2, a, b);
cat gives you better flexibility over how to concatenate.

更多回答(0 个)

类别

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

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by