I am looking for an easy way to get all combinations of a binary matrix. I already tried the perms() function, but did not get the correct result.
I have, for example, a matrix N x N filled with 1 and -1. For N = 2, there would be 2 ^ 4 possible combinations of 1 and -1, similar
(1 1) (1 1) (-1 -1) M(1) = (1 1) , M(2) = (1 -1) , M(3) = ( 1 1) and so on...
When I use perms (), I do not get, for example, the first matrix.
How can i fix this?
source share