필터 지우기
필터 지우기

column wise reshaping of the 3rd dimension?

조회 수: 1 (최근 30일)
Asl
Asl 2013년 10월 21일
편집: James Tursa 2018년 1월 16일
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

답변 (1개)

Cedric
Cedric 2013년 10월 21일
편집: Cedric 2013년 10월 21일
>> AA = reshape( permute(A, [3,2,1]), 1, [] )
AA =
1 100 1000 2 200 2000 3 300 3000 4 400 4000

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by