title: confused about the output of hist
body: <p>I am confused by the</p>
  
  <pre><code>[m,n]=hist(y,x)
  </code></pre>
  
  <p>such as </p>
  
  <pre><code>M = [1, 2, 3;
       4, 5, 6;
       1, 2, 3];
  
  [m,n] =  hist(M,1:3)
  </code></pre>
  
  <p>Which results in </p>
  
  <pre><code> m = 2     0     0
       0     2     0
       1     1     3
  </code></pre>
  
  <p>Can someone please explain how <code>m</code> is calculated?</p>