Cody

Solution 696219

Submitted on 6 Jul 2015 by LY Cao
  • Size: 24
  • This is the leading solution.
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
%% f = @(x)x; g = @(x)x+1; y = fho(f,g,1) y_correct = 3; assert(isequal(y(1),y_correct))

y = @(x)feval(ans(t),f(x),g(x))

2   Pass
%% f = @sqrt; g = @ceil; y = fho(f,g,2) y_correct = -2; assert(isequal(y(4),y_correct))

y = @(x)feval(ans(t),f(x),g(x))

3   Pass
%% f = @nextpow2; g = @log10; y = fho(f,g,3) y_correct = 4; assert(isequal(y(10),y_correct))

y = @(x)feval(ans(t),f(x),g(x))

4   Pass
%% f = @floor; g = @ceil; y = fho(f,g,4) y_correct = 0.5; assert(isequal(y(1.25),y_correct))

y = @(x)feval(ans(t),f(x),g(x))

Suggested Problems

More from this Author1