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 | Pass |
%%
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 | Pass |
%%
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)
|
2401 Solvers
1223 Solvers
given 3 sides, find area of this triangle
680 Solvers
Back to basics 8 - Matrix Diagonals
781 Solvers
2334 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!