Effacer les filtres
Effacer les filtres

column wise reshaping of the 3rd dimension?

1 vue (au cours des 30 derniers jours)
Asl
Asl le 21 Oct 2013
Modifié(e) : James Tursa le 16 Jan 2018
I have a 3d matrix A
A(:,:,1) =
1 2 ;
3 4
A(:,:,2) =
100 200 ;
300 400
A(:,:,3) =
1000 2000 ;
3000 4000
I want to reshape the data in such a way:
1 100 1000 2 200 2000 3 300 3000 4 400 4000
(Column wise reshaping of 3rd dimension)
Following code do row wise reshaping of 3rd dimension
AA =reshape(A ,[size(A,1)*size(A,2) size(A,3)]);
AA2=AA(:);
How I can do column wise reshaping?
Thanks

Réponses (1)

Cedric
Cedric le 21 Oct 2013
Modifié(e) : Cedric le 21 Oct 2013
>> AA = reshape( permute(A, [3,2,1]), 1, [] )
AA =
1 100 1000 2 200 2000 3 300 3000 4 400 4000

Catégories

En savoir plus sur Matrices and Arrays 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