How to merge tow rows in one row?

1 次查看(过去 30 天)
Mr.Hamza
Mr.Hamza 2021-3-13
评论: Mr.Hamza 2021-3-13
Hello every body
1 2 3 4
5 6 7 8
9 10 11 12
I have the above matrix and i want to merge the first and second row to be like that:
B = [ 1 2 3 4 5 6 7 8 ].

回答(1 个)

Alan Stevens
Alan Stevens 2021-3-13
Like so
A = [ 1 2 3 4
5 6 7 8
9 10 11 12];
B = [A(1,:) A(2,:)];

类别

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

Community Treasure Hunt

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

Start Hunting!

Translated by