title: matlab algorithm for specific configurations
body: <p>How to effectively implement in matlab this specific combinatorics problem?</p>
  
  <p>I have a list of possible values {{v1_1,...v1_n1},{v2_1, ..., v2_n2}, ... {vm_1, ... , vm_nm}} . I need to generate all possible configurations in this fashion:</p>
  
  <p>example of list</p>
  
  <p>{{1,2}, {3}, {2,5}}</p>
  
  <p>and corresponding configurations are</p>
  
  <pre><code>  1 3 2
    1 3 5
    2 3 2
    2 3 5
  </code></pre>
  
  <p>In my case the max(n1,...,nm) = 6 and m is small integer ( 3 &lt; m &lt; 30)</p>
  
  <p>The list is represented in my code by binary matrix m x 6</p>
  
  <p>example (3 x 6 case):
  {{1,2}, {3}, {2,5}}</p>
  
  <p>corresponding binary matrix</p>
  
  <pre><code> 1 1 0 0 0 0  ...  {1,2}
   0 0 1 0 0 0  ...  {3}
   0 1 0 0 1 0  ...  {2,5}
  </code></pre>
  
  <p>Thanks in advance for any help. </p>