Cody

Problem 42647. Recursion - Fun

Solution 3269763

Submitted on 18 Oct 2020 by Ben Vien
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
x = 1; y_correct = 0.5; assert(abs(rec_fun(x) - y_correct) < tolerance)

2   Pass
x = 5; y_correct = [0.5000 1.9500 4.7050 9.9395 19.8851]; assert(sum(abs(rec_fun(x) - y_correct)) < tolerance)

3   Pass
x = 7; y_correct = [0.5000 1.9500 4.7050 9.9395 19.8851 38.7816 74.6850]; assert(sum(abs(rec_fun(x) - y_correct)) < tolerance)

Suggested Problems

More from this Author3

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!