Problem 1890. Fixed-Point Iteration

Solution 1579645

Submitted on 10 Jul 2018 by J. S. Kowontan
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_fixed_point = fixed_point(@(x) 2./(2*x+1),0,5) assert(abs(0.8923-x_fixed_point)<1e-4)

x_fixed_point = 0.8923

2   Pass
x_fixed_point = fixed_point(@(x) 2./(2*x+1),0,20) assert(abs(0.7807-x_fixed_point)<1e-4)

x_fixed_point = 0.7807

3   Pass
x_fixed_point = fixed_point(@(x) exp(-x),0,2) assert(abs(0.3679-x_fixed_point)<1e-4)

x_fixed_point = 0.3679

4   Pass
x_fixed_point = fixed_point(@(x) exp(-x),0,10) assert(abs(0.5649-x_fixed_point)<1e-4)

x_fixed_point = 0.5649

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!