How to merge tow rows in one row?

1 Ansicht (letzte 30 Tage)
Mr.Hamza
Mr.Hamza am 13 Mär. 2021
Kommentiert: Mr.Hamza am 13 Mär. 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 ].

Antworten (1)

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

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by