title: Why is sum(X, 1) the sum of the columns in MATLAB?
body: <pre><code>&gt;&gt; X = [0 1 2
          3 4 5]
  
  &gt;&gt; sum(X, 1)
  
  ans =
  
       3     5     7
  </code></pre>
  
  <p><code>sum(X, 1)</code> should sum along the <code>1st</code> dimension(<em>row</em>) as per the document says:</p>
  
  <blockquote>
    <p>S = SUM(X,DIM) sums along the
    dimension DIM.</p>
  </blockquote>
  
  <p>But why does it actually sums along the <code>2nd</code> dimension(<em>column</em>)?</p>