MATLAB: How to sum elements of a cell array cell array I have a cell array V={[1;2;3;4],[5;6;7;8]}, I want to do a summation as follows [1+5;2+6;3+7;4+8]. I need the result to be in a matrix. Thank you Best Answer sum(cat(3,V{:}),3) Related SolutionsMATLAB: Element-by-element sum of cell array 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')) ; MATLAB: Sum the elements in the cell array Is there a specific reason you are using a cell array? This is easy with a numeric array:a = [ 1 2 3; 4 5 6; 7 8 9 ];sum(a,1) % Sum down columnssum(a,2) % Sum across rows Related QuestionSum up elements in cellsHow to create a 1×3 cell array to hold multiple individual arraysSum of elements in cell arrayHow to convert cell to arrayConvert an 18×1 cell array in a 3×6 cell arraySum the elements in cell array with different element lengthRemoving elements from a cell array
Best Answer