Question: Write a MATLAB function called fixed_point Write a MATLAB function, called fixed_point_iteration that inputs a function, g, an initial guess xo, an error tolerance, tol,

Write a MATLAB function called fixed_point

Write a MATLAB function called fixed_point Write a MATLAB function, called fixed_point_iteration

Write a MATLAB function, called fixed_point_iteration that inputs a function, g, an initial guess xo, 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 xo. Your function should have an error defined by E = x - x,-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 (8,xo, tol,N) NOTE: TEST YOUR CODE ON THE EXAMPLE DONE IN CLASS. Recall that we did an example by hand, approximating the solution for et = x with an initial guess of 3 and a total of 2 iterations. Do your answers match with the by-hand answers? To test this, type the following into the command line fixed_point_iteration (@(x) (exp(-x)),3,10^-10,2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!