MATLAB: How to obtain a set of matrix from another matrix by adding the previous row value along the column to the next row on the same column

a

Example
a= 2,4;3,4;2 1
the new matrix will be
b= 2,4;3+2,4+4;2+3+2,1+4+4
along the colums

Best Answer

Is this what you want?
>> cumsum( a, 1 )
ans =
2 4
5 8
7 9