Effacer les filtres
Effacer les filtres

Reshaphing 3D Matrix into 2D Matrix

2 vues (au cours des 30 derniers jours)
Stephan Raczak
Stephan Raczak le 6 Sep 2016
I have a 9x256x21 single matrix that I would like to convert into a 2D matrix so that the new dimensions are 9x5376. The 5376 is a multiplication of 256*21. The third dimension (21) each represents 1 second and I just want to concatenate each second columnwise.
I am aware I most likely need to use the reshape function but am unsure how. Please help me! Thanks

Réponse acceptée

Henry Giddens
Henry Giddens le 6 Sep 2016
Modifié(e) : Henry Giddens le 6 Sep 2016
Yes reshape will work
sz = size(A);
B = reshape(A,sz(1),[],1);
% or B = reshape(A,sz(1),sz(2)*sz(3));
Henry
  1 commentaire
Stephan Raczak
Stephan Raczak le 7 Sep 2016
Worked! Thanks a lot.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by