Borrar filtros
Borrar filtros

column wise reshaping of the 3rd dimension?

1 visualización (últimos 30 días)
Asl
Asl el 21 de Oct. de 2013
Editada: James Tursa el 16 de En. de 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

Respuestas (1)

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

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by