title: matlab: average group size of the same numbers
body: <p>I have a string like </p>
  
  <pre><code>a = 011112220010111122221110101111222201111111100022221111101101011... 
  </code></pre>
  
  <p>and I want to find an average size of a group of 0s, 1s and 2s (in this example will be  roughly around 3-4 for all of them). Any simple way of doing that?
  thanks!</p>