How to read 2d data and create a 3D matrix?

조회 수: 1 (최근 30일)
Burak Varol
Burak Varol 2021년 3월 11일
댓글: Burak Varol 2021년 3월 11일
I have a data which goes like the following:
A(1,1,1).....................A(1000,1,1)
A(1,2,1)......................A(1000,2,1)
...
A(1,110,1).................A(1000,110,1)
A(1,1,2)......................A(1000,1,2)
....
....................................A(1000,110,110)
how can I rehape this data as A 3d matrix? .

채택된 답변

Jan
Jan 2021년 3월 11일
B = reshape(A.', 1000, 110, 100);
In general all such transformations can be done by:
B = reshape(permute(reshape(A, [x,y,z]), [a,b,c]), [d,e,f])
In this case the inner reshape can be omitted and the permutation is a transposition.

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by