title: Counting frequency of a sequence within a vector
body: <p>Let's say I have a binary vector of length N, and I'm looking for the frequency of each of the following 16 sequences in that vector:</p>
  
  <pre><code>0000, 0001, 0010, 0011, ..., 1111
  </code></pre>
  
  <p>What is the easiest way to count these frequency of each of these sequences in the vector?  Ideally, I'd like to know how to do this in MatLab.</p>