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

38 ビュー (過去 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}
  1 件のコメント
Abdulhakim Alezzi
Abdulhakim Alezzi 2022 年 2 月 17 日
Thank you so much Stephen, it is all right now.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by