cumsum of a matrix

Asked by Mate 2u on 25 May 2012
Latest activity Answered by the cyclist on 25 May 2012

Hi there I have a nxm matrix. I want to do the cumsum of each column, then all of them added up to give one total cumsum.

Any help?

0 Comments

Mate 2u

Tags

Products

No products are associated with this question.

2 Answers

Answer by Wayne King on 25 May 2012
   X = 1:100;
   X = reshape(X,10,10);
   X1 = cumsum(X(:));

0 Comments

Wayne King
Answer by the cyclist on 25 May 2012

Is this what you mean?

M = rand(5,6);
S = sum(cumsum(M),2);

0 Comments

the cyclist

Contact us