Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
x = 1.33;
y_correct = [1 1 3];
assert(isequal(MixedFraction(x),y_correct))
x =
0.3300
m =
0.5000
0.3300
0.2500
0.2000
0.1700
0.1400
0.1300
0.1100
0.6700
0.5000
0.4000
0.3300
0.2900
0.2500
0.2200
0.7500
0.6000
0.5000
0.4300
0.3800
0.3300
0.8000
0.6700
0.5700
0.5000
0.4400
0.8300
0.7100
0.6300
0.5600
0.8600
0.7500
0.6700
0.8800
0.7800
0.8900
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
1.3300
1.6700
2.0000
2.3300
2.6700
3.0000
1.2500
1.5000
1.7500
2.0000
2.2500
1.2000
1.4000
1.6000
1.8000
1.1700
1.3300
1.5000
1.1400
1.2900
1.1300
ans =
1 3
2 6
3 9
|
2 | Fail |
x = 1.66;
y_correct = [1 2 3];
assert(isequal(MixedFraction(x),y_correct))
x =
0.6600
m =
0.5000
0.3300
0.2500
0.2000
0.1700
0.1400
0.1300
0.1100
0.6700
0.5000
0.4000
0.3300
0.2900
0.2500
0.2200
0.7500
0.6000
0.5000
0.4300
0.3800
0.3300
0.8000
0.6700
0.5700
0.5000
0.4400
0.8300
0.7100
0.6300
0.5600
0.8600
0.7500
0.6700
0.8800
0.7800
0.8900
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
1.3300
1.6700
2.0000
2.3300
2.6700
3.0000
1.2500
1.5000
1.7500
2.0000
2.2500
1.2000
1.4000
1.6000
1.8000
1.1700
1.3300
1.5000
1.1400
1.2900
1.1300
ans =
0×2 empty double matrix
|
3 | Fail |
x = 2.33;
y_correct = [1 4 3];
assert(isequal(MixedFraction(x),y_correct))
x =
1.3300
m =
0.5000
0.3300
0.2500
0.2000
0.1700
0.1400
0.1300
0.1100
0.6700
0.5000
0.4000
0.3300
0.2900
0.2500
0.2200
0.7500
0.6000
0.5000
0.4300
0.3800
0.3300
0.8000
0.6700
0.5700
0.5000
0.4400
0.8300
0.7100
0.6300
0.5600
0.8600
0.7500
0.6700
0.8800
0.7800
0.8900
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
1.3300
1.6700
2.0000
2.3300
2.6700
3.0000
1.2500
1.5000
1.7500
2.0000
2.2500
1.2000
1.4000
1.6000
1.8000
1.1700
1.3300
1.5000
1.1400
1.2900
1.1300
ans =
4 3
8 6
|
4 | Fail |
x = 2.25;
y_correct = [1 5 4];
assert(isequal(MixedFraction(x),y_correct))
x =
1.2500
m =
0.5000
0.3300
0.2500
0.2000
0.1700
0.1400
0.1300
0.1100
0.6700
0.5000
0.4000
0.3300
0.2900
0.2500
0.2200
0.7500
0.6000
0.5000
0.4300
0.3800
0.3300
0.8000
0.6700
0.5700
0.5000
0.4400
0.8300
0.7100
0.6300
0.5600
0.8600
0.7500
0.6700
0.8800
0.7800
0.8900
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
1.3300
1.6700
2.0000
2.3300
2.6700
3.0000
1.2500
1.5000
1.7500
2.0000
2.2500
1.2000
1.4000
1.6000
1.8000
1.1700
1.3300
1.5000
1.1400
1.2900
1.1300
ans =
5 4
|
5 | Fail |
x = 2.28;
y_correct = [1 9 7];
assert(isequal(MixedFraction(x),y_correct))
x =
1.2800
m =
0.5000
0.3300
0.2500
0.2000
0.1700
0.1400
0.1300
0.1100
0.6700
0.5000
0.4000
0.3300
0.2900
0.2500
0.2200
0.7500
0.6000
0.5000
0.4300
0.3800
0.3300
0.8000
0.6700
0.5700
0.5000
0.4400
0.8300
0.7100
0.6300
0.5600
0.8600
0.7500
0.6700
0.8800
0.7800
0.8900
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
1.3300
1.6700
2.0000
2.3300
2.6700
3.0000
1.2500
1.5000
1.7500
2.0000
2.2500
1.2000
1.4000
1.6000
1.8000
1.1700
1.3300
1.5000
1.1400
1.2900
1.1300
ans =
0×2 empty double matrix
|
6 | Fail |
x = 2.00;
y_correct = [1 5 5];
assert(isequal(MixedFraction(x),y_correct))
x =
1
m =
0.5000
0.3300
0.2500
0.2000
0.1700
0.1400
0.1300
0.1100
0.6700
0.5000
0.4000
0.3300
0.2900
0.2500
0.2200
0.7500
0.6000
0.5000
0.4300
0.3800
0.3300
0.8000
0.6700
0.5700
0.5000
0.4400
0.8300
0.7100
0.6300
0.5600
0.8600
0.7500
0.6700
0.8800
0.7800
0.8900
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
1.5000
2.0000
2.5000
3.0000
3.5000
4.0000
4.5000
1.3300
1.6700
2.0000
2.3300
2.6700
3.0000
1.2500
1.5000
1.7500
2.0000
2.2500
1.2000
1.4000
1.6000
1.8000
1.1700
1.3300
1.5000
1.1400
1.2900
1.1300
ans =
0×2 empty double matrix
|
381 Solvers
Set some matrix elements to zero
290 Solvers
Determine the number of odd integers in a vector
435 Solvers
273 Solvers
360 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!