Borrar filtros
Borrar filtros

how can i combine 4 matrix as 1

4 visualizaciones (últimos 30 días)
bhavisha parmar
bhavisha parmar el 7 de Oct. de 2015
Respondida: Star Strider el 7 de Oct. de 2015
for example A=[1 2],B=[3 4],C=[5 6] and D=[7 8] then the resultant matrix E E=[1 2 3 4
5 6 7 8]
it means it becomes 2*4 matrix

Respuestas (1)

Star Strider
Star Strider el 7 de Oct. de 2015
You need to horizontally concatenate the vectors, then use the reshape function:
A=[1 2];
B=[3 4];
C=[5 6];
D=[7 8];
E = reshape([A B C D], [], 2).'
E =
1 2 3 4
5 6 7 8

Categorías

Más información sobre Matrices and 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