Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE DO NOT COPY OTHER CHEGG ANSWERS, AND PLEASE USE MATLAB. Write a matlab function [x, counte r]= steffensen (f,x0,tol) to find the root of
PLEASE DO NOT COPY OTHER CHEGG ANSWERS, AND PLEASE USE MATLAB.
Write a matlab function [x, counte r]= steffensen (f,x0,tol) to find the root of the function f with initial guess x0 and a estimated relative error less than tol. The function returns the estimated root x and the number of iterations counter needed to calculated it. The Steffensen's method is a modification of the Newton's method that does not require the evaluation of the derivative of the function. The iteration proceeds as follows: xi+1=xif(xi+f(xi))f(xi)f(xi)2. One way to look at it is that h=f(xi) is used as a step, and (f(xi+h)f(xi))/h is used as an estimate of the derivative. Limit the number of interations to 100 . Function Code to call your function ? 1f=a(x)(0.5xsin(x)) 2[x, counter ]=steffensen(f,pi,1e2)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started