Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [1 0 0 0 0 3 0 0];
y_correct = 20.30;
assert(isequal(mymoney(x),y_correct))
a =
20
b =
0
c =
0
d =
0
e =
0
f =
0.3000
g =
0
h =
0
y =
20.3000
|
2 | Pass |
x = [1 0 1 0 2 3 0 0];
y_correct = 25.80;
assert(isequal(mymoney(x),y_correct))
a =
20
b =
0
c =
5
d =
0
e =
0.5000
f =
0.3000
g =
0
h =
0
y =
25.8000
|
3 | Pass |
x = [0 0 0 3 2 3 5 9];
y_correct = 4.14;
assert(isequal(mymoney(x),y_correct))
a =
0
b =
0
c =
0
d =
3
e =
0.5000
f =
0.3000
g =
0.2500
h =
0.0900
y =
4.1400
|
4 | Pass |
x = [1 2 0 0 0 0 0 0];
y_correct = 40.00;
assert(isequal(mymoney(x),y_correct))
a =
20
b =
20
c =
0
d =
0
e =
0
f =
0
g =
0
h =
0
y =
40
|
Set the array elements whose value is 13 to 0
935 Solvers
Create a vector whose elements depend on the previous element
391 Solvers
277 Solvers
289 Solvers
100 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!