Hello
i have a cell array that i want to sum the coulmns ;
A={ 1x2 double , 1x2 double
1x2 double , 1x2 double
1x2 double , 1x2 double
1x2 double , 1x2 double }

 채택된 답변

KSSV
KSSV 2019년 5월 7일

0 개 추천

A = cell(4,2) ;
for i = 1:4
for j = 1:2
A{i,j} = rand(1,2) ;
end
end
B = cellfun(@sum,A)

추가 답변 (1개)

madhan ravi
madhan ravi 2019년 5월 7일

0 개 추천

sum(cat(1,A{:}),2)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2019년 5월 7일

댓글:

2019년 5월 10일

Community Treasure Hunt

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

Start Hunting!

Translated by