MATLAB: How to create N-tuples in Matlab

MATLAB

What would be the easiest way to create a list of n-tuples in Matlab?
For example, if I want to generate all possible 3-tuples of 0 and 1: I'd want to generate the following set of tuples:
((0,0,0),(0,0,1),(0,1,0),(0,1,1),(1,0,0),(1,0,1),(1,1,0),(1,1,1))

Best Answer

dec2bin(0:2^3-1)-'0'