Generating all the n-dimensional array in Matlab in which each entry can get only two value

65 Views Asked by At

I wanted to generate all the n-dimensional vectors that each of its entries can get only two values (e.g. for n=3 we get $2^3=8$ vectors) and put all these vectors into a matrix. Is any specific command for this purpose? I'll appreciate any help!

Thanks