f = @(n)bin2dec(fliplr(dec2bin(0:2^n-1)))f(0)f(1)f(2)f(3)
Standard input is empty
f = @(n) bin2dec (fliplr (dec2bin (0:2 ^ n - 1))) ans = 0 ans = 0 1 ans = 0 2 1 3 ans = 0 4 2 6 1 5 3 7
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!