I\'d like to generate all the permutations of n entries in a w x h matrix: example with a 2x2 matrix and n = 1:
| 1 0 | | 0 0 | | 0 1 | | 0 0 | | 0 0 | | 1