필터 지우기
필터 지우기

3D matrix transpose and dimensioning

조회 수: 2 (최근 30일)
Vecihi He
Vecihi He 2023년 1월 24일
댓글: KSSV 2023년 1월 25일
When I take the pagetranspose of the matrix I, which has the size shown in Fig. 1 below, I get the matrix "Itilde", which has the size shown in Fig. 2. But I want the size of each cell of the Itilde matrix to be 29x64. Below, the cells in a single column are 29x64x4. How can I divide it into 4 columns and make the size of each cell 29x64 as shown in Fig. 3?
Fig .1
Fig.2
Fig.3
Thanks.
  댓글 수: 1
Steven Lord
Steven Lord 2023년 1월 24일
When I take the pagetranspose of the matrix I, which has the size shown in Fig. 1 below, I get the matrix "Itilde", which has the size shown in Fig. 2.
The pagetranspose function does not change a double array (your original matrix, shown in Fig. 1) into a cell array (Fig. 2). Therefore your code performs some other operation that you're not showing us. If you show us that operation we may be able to help you modify it to achieve your goal.

댓글을 달려면 로그인하십시오.

답변 (1개)

KSSV
KSSV 2023년 1월 24일
% Data for demo
A{1,1} = rand(3,3,3) ;
A{2,1} = rand(3,3,3) ;
A{3,1} = rand(3,3,3) ;
A{4,1} = rand(3,3,3) ;
A
A = 4×1 cell array
{3×3×3 double} {3×3×3 double} {3×3×3 double} {3×3×3 double}
% Conversion
B = cell(4,3) ;
for i = 1:4
for j = 1:3
B{i,j} = A{i}(:,:,j) ;
end
end
B
B = 4×3 cell array
{3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double} {3×3 double}
  댓글 수: 2
Vecihi He
Vecihi He 2023년 1월 25일
This is exactly the answer I was looking for thank you very much :)
KSSV
KSSV 2023년 1월 25일
Thanks is accepting the answer.. :)

댓글을 달려면 로그인하십시오.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by