MATLAB Answers

Kobi
0

how to sum matrics inside a cell array?

Asked by Kobi
on 6 Aug 2014
Latest activity Edited by Fatih
on 6 Aug 2014
i have 4 matrics inside a cell and i need to sum them all currenyly i use this:
R=R{1}+R{2}+R{3}+R{4}
the original R is a cell with 4 matrics

  0 Comments

Sign in to comment.

Products

1 Answer

Answer by Fatih
on 6 Aug 2014
Edited by Fatih
on 6 Aug 2014

Sorry, maybe I have not enough information. but methinks I understand you. if you want to sum all elements of matrix. please write matrix in this view.
R = [R1 R2 R3 R4];
%and after that
result = sum(sum(R));
if your matrixes arent same row lenght you cannot use this way.

  0 Comments

Sign in to comment.