Cody

# Problem 44971. Convert base 10 to base x (2-16)

Solution 1960093

Submitted on 4 Oct 2019 by William
• Size: 112
• This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
dec = [12345.12345,9876.9876]; x = 16; y_correct={'3039.1f9a6b50b','2694.fcd35a8588'}; assert(isequal(dec2basex(dec,x),y_correct))

2   Pass
dec = [12345.12345,9876.9876]; x = 7; y_correct={'50664.0602255245326442','40536.6625141031624663'}; assert(isequal(dec2basex(dec,x),y_correct))

3   Pass
dec= [9626.150562201365,389979.4884571975,981037227081.0962,15.15348748187026,2951227.338373619,409,667123.807,30421.507,7285.4,38.59]; x=2; y_correct={'10010110011010.0010011010001011','1011111001101011011.0111110100001011','1110010001101010011000000001110001001001.00011000101','1111.0010011101001010','1011010000100000111011.0101011010011111','110011001','10100010110111110011.1100111010010111','111011011010101.1000000111001010','1110001110101.0110011001100110','100110.1001011100001010'}; assert(isequal(dec2basex(dec,x),y_correct))

4   Pass