MATLAB Answers

0

how to sum elements of a cell array

Asked by mohamed Faraj on 14 Aug 2019
Latest activity Answered by madhan ravi
on 14 Aug 2019
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

  0 Comments

Sign in to comment.

Tags

1 Answer

Answer by madhan ravi
on 14 Aug 2019
 Accepted Answer

sum(cat(3,V{:}),3)

  0 Comments

Sign in to comment.