X-Git-Url: http://gitweb.michael.orlitzky.com/?p=octave.git;a=blobdiff_plain;f=fixed_point_method.m;h=a70a1ac74db3c361b11c6d5e9bf3dea16af92dd4;hp=eb3b61c27729331e7b76828625f3874a8c44f04f;hb=b12c6c2a4bf4cef29b2e08b743c92889505c7ed9;hpb=e1b71b4ca7cfa08ac76744a17a3778d4ccfaa7e2 diff --git a/fixed_point_method.m b/fixed_point_method.m index eb3b61c..a70a1ac 100644 --- a/fixed_point_method.m +++ b/fixed_point_method.m @@ -1,21 +1,21 @@ function [fixed_point, iterations] = fixed_point_method(g, epsilon, x0) - ## Find a fixed_point of the function `g` with initial guess x0. - ## - ## INPUTS: - ## - ## * ``g`` - The function to iterate. - ## - ## * ``epsilon`` - We stop when two successive iterations are within - ## epsilon of each other, taken under the infinity norm. halt the - ## search and return the current approximation. - ## - ## OUTPUTS: - ## - ## * ``fixed_point`` - The fixed point that we found. - ## - ## * ``iterations`` - The number of iterations that we performed - ## during the search. - ## + % Find a fixed_point of the function `g` with initial guess x0. + % + % INPUTS: + % + % * ``g`` - The function to iterate. + % + % * ``epsilon`` - We stop when two successive iterations are within + % epsilon of each other, taken under the infinity norm. halt the + % search and return the current approximation. + % + % OUTPUTS: + % + % * ``fixed_point`` - The fixed point that we found. + % + % * ``iterations`` - The number of iterations that we performed + % during the search. + % iterations = 0; prev = x0;