How to merge tow rows in one row?

1 visualización (últimos 30 días)
Mr.Hamza
Mr.Hamza el 13 de Mzo. de 2021
Comentada: Mr.Hamza el 13 de Mzo. de 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 ].

Respuestas (1)

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

Categorías

Más información sobre Multidimensional Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by