title: Matlab: command to get counts of elements in a list
body: <p>I need the counts of each element in the list. Is there some ready command for this?</p>
  
  <pre><code>&gt;&gt; [1 1 5 5 10 12 12 2 2 2]
  
  ans =
  
       1     1     5     5    10    12    12    2    2    2
  </code></pre>
  
  <p><strong>Goal:</strong> getting counts like this</p>
  
  <pre><code>&gt;&gt; [1, 2; 5, 2; 10, 1; 12, 2]
  
  ans =
  
       1     2
       2     3
       5     2
      10     1
      12     2
  </code></pre>