Cody

# Problem 511. Converting Decimal to Binary

Solution 3233278

Submitted on 16 Oct 2020
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   Fail
d = 1; b = '1'; assert(isequal(dec2bin_fractions(d),b))

Undefined function 'de2bi' for input arguments of type 'double'. Error in dec2bin_fractions (line 2) b=de2bi(d); Error in Test1 (line 3) assert(isequal(dec2bin_fractions(d),b))

2   Fail
d = 2.5; b = '10.1'; assert(isequal(dec2bin_fractions(d),b))

Undefined function 'de2bi' for input arguments of type 'double'. Error in dec2bin_fractions (line 2) b=de2bi(d); Error in Test2 (line 3) assert(isequal(dec2bin_fractions(d),b))

3   Fail
d = 34.125; b = '100010.001'; assert(isequal(dec2bin_fractions(d),b))

Undefined function 'de2bi' for input arguments of type 'double'. Error in dec2bin_fractions (line 2) b=de2bi(d); Error in Test3 (line 3) assert(isequal(dec2bin_fractions(d),b))

4   Fail
d = 452.8125; b = '111000100.1101'; assert(isequal(dec2bin_fractions(d),b))

Undefined function 'de2bi' for input arguments of type 'double'. Error in dec2bin_fractions (line 2) b=de2bi(d); Error in Test4 (line 3) assert(isequal(dec2bin_fractions(d),b))

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!