title: Using cumsum by columns
body: <p>I have a matrix, for example:</p>
  
  <pre><code>A= [ 1 2 3 4
       3 5 6 6
       4 1 2 3 ]
  </code></pre>
  
  <p>I want to get the cumulative sum of the columns in the form of another matrix (or data frame). For example, this matrix would give:</p>
  
  <pre><code>B= [1 2 3 4
      4 7 9 10
      8 8 8 13]
  </code></pre>