フィルターのクリア

Summing up rows of a cell containing 3D matrices

2 ビュー (過去 30 日間)
maubars
maubars 2021 年 1 月 19 日
コメント済み: maubars 2021 年 1 月 20 日
I wish to sum all rows of a cell below containing 3D arrays to obtain a cell summations as seen below and to further concatate the columns into a 3D array. I Please assist.
Cell =
5×5 cell array
{30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double}
{30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double}
{30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double}
{30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double}
{30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double}
% Sum rows to get the below cell summation
Cell_Summation =
1×5 cell array
{30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double} {30×30×30 double}
% Concatate the columns to get the below final cell summation in the x axis or even better an a array
Final_Cell_Summation =
1×1 cell array % or array
{30×150×30 double}

採用された回答

Matt J
Matt J 2021 年 1 月 19 日
C=reshape( cat(2,Cell{:}) ,[30,30,5,5,30]);
Final=reshape( sum(C,3) , 30,150,30);
  1 件のコメント
maubars
maubars 2021 年 1 月 20 日
Thanks. Much Appreciated.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by