Question: Fixed point method O solutions submitted (max: Unlimited) Write a MATLAB function, called fixed_point_iteration that inputs a function, &, an initial guess x_0, an error

 Fixed point method O solutions submitted (max: Unlimited) Write a MATLAB

Fixed point method O solutions submitted (max: Unlimited) Write a MATLAB function, called fixed_point_iteration that inputs a function, &, 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,xo, tol,n) Use the code you just developed to find the solution to the equations x = e-X and x = 1, with an accuracy of 10-10 for x in (-1, 1 + x 1]. State your initial guess, and how many iterations it took. Plot on the same graph, y = g(x) and y = x. Here c is the fixed-point solution and n the number of iterations the method takes. To avoid function/variable override, let g = 2^{-x} and g1 = 1/(1+x). Furthermore, when you call the fixed_point_iteration function, do the following: [c,n, err] = fixed_point_iteration(g,xo, tol,N) [c1, n1, err1] = fixed_point_iteration(91,x01, tol,N1) The MATLAB function for ex is exp(-x)

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!