필터 지우기
필터 지우기

How to convert a 4D double matrix into a cell array

조회 수: 16 (최근 30일)
Abdulhakim Alezzi
Abdulhakim Alezzi 2022년 2월 17일
댓글: Abdulhakim Alezzi 2022년 2월 17일
Hi fellows;
I am having a 4D matrix, X (376 * 30 * 20 *44).
i want to convert the X matrix into the a cell array of (1*44), where every row in the output will be (376 * 30 * 20).
I have tried the following code, but does not work.
Anything will be appreciated .
A= num2cell (X, 376, 30, 20,[]);

채택된 답변

Stephen23
Stephen23 2022년 2월 17일
A = rand(376,30,20,44);
C = num2cell(A,1:3);
C = reshape(C,1,[])
C = 1×44 cell array
{376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double} {376×30×20 double}

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by