필터 지우기
필터 지우기

element-by-element sum of cell array

조회 수: 16 (최근 30일)
Haneya Qureshi
Haneya Qureshi 2018년 4월 23일
답변: KSSV 2018년 4월 23일
I have a cell A of size 100: A{1,1}=[1 2 3 4]; A{1,2}=[5 6 7 8]; ...A{1,100}=[10 11 12 13];
I want to take element-by-element sum. SUMA should be a vector containing 4 elements where 1st element is sum of 1st entry of all A{1,i} elements, where i=1 to 100 and so on. How can i do this?

채택된 답변

KSSV
KSSV 2018년 4월 23일
A{1,1}=[1 2 3 4]; A{1,2}=[5 6 7 8]; A{1,3}=[10 11 12 13];
iwant = sum(cell2mat(A')) ;

추가 답변 (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