Watch this Author's files
Why use a slow, un-preallocated, unvectorized code, when there is a one-liner available?
dec2bin(0:(nb_possibles-1))=='0'
The lack of pre-allocation make this pretty slow. Moreover it errors on certain input (e.g., 5). And what is the use of this function if nb_possibles is not a power of 2?
Contact us at files@mathworks.com