How to effectively implement in matlab this specific combinatorics problem?
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:
example of list
{{1,2}, {3}, {2,5}}
and corresponding configurations are
1 3 2
1 3 5
2 3 2
2 3 5
In my case the max(n1,...,nm) = 6 and m is small integer ( 3 < m < 30)
The list is represented in my code by binary matrix m x 6
example (3 x 6 case): {{1,2}, {3}, {2,5}}
corresponding binary matrix
1 1 0 0 0 0 ... {1,2}
0 0 1 0 0 0 ... {3}
0 1 0 0 1 0 ... {2,5}
Thanks in advance for any help.