Question: Write a MATLAB function, called f ixed_point_iteration that inputs a function, g, an initial guess x_0, an error tolerance, tol, and a maximum number of

Write a MATLAB function, called f ixed_point_iteration that inputs a function, g, an initial guess x_0, an error tolerance, tol, and a maximum number of iterations, N, and outputs the fixed point of g, obtained using the fixed point iteration, starting with x_0. Your function should have an error defined by E = |x_n - x_n - 1|, and stop when the error is less than the tolerance, or if the number of iterations exceeds N- whichever happens first. Your function header should look something like: function [c, n, err] = fixed_point_iteration (g, x0, tol, N)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
