title: Combinations of rows in Matlab?
body: <p>I have a matrix <code>W</code> in Matlab of dimension <code>nx2</code> and I would like to construct
  a list of <code>2x1</code> cells listing in cell <code>1</code> a possible combination of rows of <code>W</code> taken <code>k</code> at a time and in cell <code>2</code> the left rows of <code>W</code>. </p>
  
  <pre><code>Example: 
  
  n=9;
  
  W=[0 1; 0 2; 0 3; 0 4; 0 5; 1 6; 2 6; 3 6]; 
  
  k=1;
  
  W_1=[{[0 1]}; {[0 2; 0 3; 0 4; 0 5; 1 6; 2 6; 3 6]}]; 
  W_2=[{[0 2]}; {[0 1; 0 3; 0 4; 0 5; 1 6; 2 6; 3 6]}];
  W_3=[{[0 3]}; {[0 1; 0 2; 0 4; 0 5; 1 6; 2 6; 3 6]}];
  W_4=[{[0 4]}; {[0 1; 0 2; 0 3; 0 5; 1 6; 2 6; 3 6]}]; 
  W_5=[{[0 5]}; {[0 1; 0 2; 0 3; 0 4; 1 6; 2 6; 3 6]}];
  W_6=[{[1 6]}; {[0 1; 0 2; 0 3; 0 4; 0 5; 2 6; 3 6]}]; 
  W_7=[{[2 6]}; {[0 1; 0 2; 0 3; 0 4; 0 5; 1 6; 3 6]}]; 
  W_8=[{[3 6]}; {[0 1; 0 2; 0 3; 0 4; 0 5; 1 6; 2 6]}];
  </code></pre>