Summing up rows of a cell containing 3D matrices

조회 수: 1 (최근 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);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by