Cody

# Problem 2162. Let's get back to school: create mixed numbered fraction

Solution 1873056

Submitted on 13 Jul 2019
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
x = 1.33; y_correct = [1 1 3]; assert(isequal(MixedFraction(x),y_correct))

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2. Error in MixedFraction (line 4) y(2,3) = [n d] Error in Test1 (line 3) assert(isequal(MixedFraction(x),y_correct))

2   Fail
x = 1.66; y_correct = [1 2 3]; assert(isequal(MixedFraction(x),y_correct))

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2. Error in MixedFraction (line 4) y(2,3) = [n d] Error in Test2 (line 3) assert(isequal(MixedFraction(x),y_correct))

3   Fail
x = 2.33; y_correct = [1 4 3]; assert(isequal(MixedFraction(x),y_correct))

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2. Error in MixedFraction (line 4) y(2,3) = [n d] Error in Test3 (line 3) assert(isequal(MixedFraction(x),y_correct))

4   Fail
x = 2.25; y_correct = [1 5 4]; assert(isequal(MixedFraction(x),y_correct))

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2. Error in MixedFraction (line 4) y(2,3) = [n d] Error in Test4 (line 3) assert(isequal(MixedFraction(x),y_correct))

5   Fail
x = 2.28; y_correct = [1 9 7]; assert(isequal(MixedFraction(x),y_correct))

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2. Error in MixedFraction (line 4) y(2,3) = [n d] Error in Test5 (line 3) assert(isequal(MixedFraction(x),y_correct))

6   Fail
x = 2.00; y_correct = [1 5 5]; assert(isequal(MixedFraction(x),y_correct))

Unable to perform assignment because the size of the left side is 1-by-1 and the size of the right side is 1-by-2. Error in MixedFraction (line 4) y(2,3) = [n d] Error in Test6 (line 3) assert(isequal(MixedFraction(x),y_correct))

### Community Treasure Hunt

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

Start Hunting!