This solution is outdated. To rescore this solution, sign in.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
f1 = @(x)x+1;
f2 = @(x)3*x;
f3 = @sqrt;
h = compose(f1,f2,f3);
assert(isequal(h(9),10));
h =
function_handle with value:
@(x)varargin{length(varargin)}(x)
|
2 | Pass |
f = repmat({@(x)x+1},1,100);
h = compose(f{:});
assert(isequal(h(0),100));
h =
function_handle with value:
@(x)varargin{length(varargin)}(x)
|
3 | Pass |
f = @(x)x;
h = compose(f);
assert(isequal(h(1234),1234));
h =
function_handle with value:
@(x)varargin{length(varargin)}(x)
|
1763 Solvers
Back to basics 20 - singleton dimensions
254 Solvers
The Answer to Life, the Universe, and Everything
383 Solvers
432 Solvers
641 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!