How to merge tow rows in one row?

1 visualizzazione (ultimi 30 giorni)
Mr.Hamza
Mr.Hamza il 13 Mar 2021
Commentato: Mr.Hamza il 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 ].

Risposte (1)

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

Categorie

Scopri di più su Multidimensional Arrays in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by