Filter löschen
Filter löschen

column wise reshaping of the 3rd dimension?

1 Ansicht (letzte 30 Tage)
Asl
Asl am 21 Okt. 2013
Bearbeitet: James Tursa am 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

Antworten (1)

Cedric
Cedric am 21 Okt. 2013
Bearbeitet: Cedric am 21 Okt. 2013
>> AA = reshape( permute(A, [3,2,1]), 1, [] )
AA =
1 100 1000 2 200 2000 3 300 3000 4 400 4000

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by