1 function [fixed_point, iterations] = fixed_point_method(g, epsilon, x0)
2 ## Find a fixed_point of the function `g` with initial guess x0.
6 ## * ``g`` - The function to iterate.
8 ## * ``epsilon`` - We stop when two successive iterations are within
9 ## epsilon of each other, taken under the infinity norm. halt the
10 ## search and return the current approximation.
14 ## * ``fixed_point`` - The fixed point that we found.
16 ## * ``iterations`` - The number of iterations that we performed
24 while (norm(current - prev, Inf) > epsilon)
27 iterations = iterations + 1;
30 fixed_point = current;