%% Base-3 Digit-Reversed Order
% Obtain the digit-reversed, radix base-3 ordered output of a vector containing 9 values. Obtain the same result by converting to base 3 and reversing the digits.

x = (0:8)';

y = digitrevorder(x,3);

c1 = dec2base(x,3);
c2 = fliplr(c1);
c3 = base2dec(c2,3);

T = table(x,y,c1,c2,c3)

% Copyright 2015 The MathWorks, Inc.