How to merge tow rows in one row?

1 view (last 30 days)
Mr.Hamza
Mr.Hamza on 13 Mar 2021
Commented: Mr.Hamza on 13 Mar 2021
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 ].

Answers (1)

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

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!