how to calculate sum between cell

조회 수: 1 (최근 30일)
Fabyola
Fabyola 2021년 10월 18일
답변: Mathieu NOE 2021년 10월 18일
i want to ask how do i supposed to do if i had a 'A' variables that contain 1x3 cell, and in every cell have 1x7 double. and i want to sum the every column of the cell. Thanks in advance

채택된 답변

Mathieu NOE
Mathieu NOE 2021년 10월 18일
hello
see example below :
% example data
for ci = 1:3
A{ci} = rand(1,7);
end
% do a horizontal sum
B = sum(cell2mat(A(:)),2);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by