Concatenation of 3D Array into 2D Array

Sorry if this is a bit of an elementary issue, but I could use some help concatenating a 3D matrix (20x12x30), A, into a 2D matrix (20x360),B, so that
B(:,1:12) = A(:,:,1)
B(:,13:24) = A(:,:,2)
etc.
I'm hoping to do this outside of a loop to save some computing time.

 Respuesta aceptada

Image Analyst
Image Analyst el 17 de Feb. de 2014
Try this:
B = reshape(A, [20, 360])

Más respuestas (1)

Azzi Abdelmalek
Azzi Abdelmalek el 17 de Feb. de 2014
A=rand(20,12,30)
B=A(:,:)

1 comentario

Mariana
Mariana el 22 de Nov. de 2017
This concatenate horizontally. How to concatenate vertically?

Iniciar sesión para comentar.

Categorías

Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 17 de Feb. de 2014

Comentada:

el 22 de Nov. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by