Effacer les filtres
Effacer les filtres

Concatenation of 3D Array into 2D Array

18 vues (au cours des 30 derniers jours)
Elizabeth
Elizabeth le 17 Fév 2014
Commenté : Mariana le 22 Nov 2017
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.

Réponse acceptée

Image Analyst
Image Analyst le 17 Fév 2014
Try this:
B = reshape(A, [20, 360])
  1 commentaire
Elizabeth
Elizabeth le 18 Fév 2014
This worked! Thank you!

Connectez-vous pour commenter.

Plus de réponses (1)

Azzi Abdelmalek
Azzi Abdelmalek le 17 Fév 2014
A=rand(20,12,30)
B=A(:,:)
  1 commentaire
Mariana
Mariana le 22 Nov 2017
This concatenate horizontally. How to concatenate vertically?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by