title: Recognizing poker hands from a 2D matrix of values
body: <p>I have a 1000 x 5 sorted matrix with numbers from 1-13.  Each number denotes the numerical value of a playing card.  The Ace has the value 1, then the numbers 2 through 10 follow, then the Jack has value 11, Queen with value 12 and King with value 13.  Therefore, each row of this matrix constitutes a poker hand.   I am trying to create a program that recognizes poker hands using these  cards that are enumerated in this way.</p>
  
  <p>For example:</p>
  
  <pre><code>A =  [1 1 2 4 5;  2 3 4 5 7;  3, 3, 5, 5, 6; 8, 8, 8, 9, 9]
  </code></pre>
  
  <p>Therefore, in this matrix <code>A</code>, the first row has a pair (1,1). The second row has high card (7), the third row has two pair ((3,3) and (5,5)) and the last one is a full house (Pair of 9s and 3 of a kind (8). </p>
  
  <p>Is there a good way to do this in MATLAB?</p>