This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
f= @(x) x+1;
g= @(x) x/2;
h= @(x) x^2;
x1 = 8 ; x2 = 10; x3=1;
y1 = 33; y2 = 51; y3=1.5;
y=compose3(f,g,h);
assert(isequal(y(x1),y1))
assert(isequal(y(x2),y2))
assert(isequal(y(x3),y3))
|
2 | Fail |
f= @(x) log(x);
g= @(x) x+6;
h= @(x) x/2;
x1 = 8 ; x2 = 4.4; x3 = 6;
y1 = 2.3026; y2 = 2.1041; y3=2.1972;
y=compose3(f,g,h);
assert(abs(y(x1)-y1)<=1e-4)
assert(abs(y(x2)-y2)<=1e-4)
assert(abs(y(x3)-y3)<=1e-4)
|
325 Solvers
546 Solvers
Rounding off numbers to n decimals
1050 Solvers
187 Solvers
234 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!