The cumSum command finds the cumulated sum of each column of a matrix (see also Section 6.40.26).
Example.
Input:
Output:
⎡ ⎢ ⎢ ⎣ |
| ⎤ ⎥ ⎥ ⎦ |
since the cumulated sums of the first column are: 1, 1+3=4, 1+3+5=9 and the accumulated sums of the second column are: 2, 2+4=6, 2+4+6=12.