For example, for n=3, there are 8 rows, and they are 000,100,010,001,110,101,001,111 (may not in this order). Any fast way to realize it using a function, say f(n)?
MATLAB: How to create a 2^n by n matrix that the rows of the matrix enumerate all the possibilities for a n digit binary number
algorithm
Best Answer