Question: Part D A much better way to solve these type of problems is using Newton's method, the secant method, or bisection. We will focus on


Part D A much better way to solve these type of problems is using Newton's method, the secant method, or bisection. We will focus on the Secant Method now. The Secant Method proceeds as follows: Given a couple of guesses (hopefully good ones) x; and X;-1 for the root of a function f, it finds a hopefully more accurate next guess X;+1 given by f(x;) Xj+1 = Y; f(x;)-f(2j-1) X;-rj-1 Write a function called MySecant which takes as inputs, a function f, two initial guesses, and a tolerance. The function should loop until the two most recent guesses differ by an amount less than the tolerance. It should then return the last guess obtained (which should be the most accurate). MATLAB's Grader Submit your code in Part 1 Function i function z=MySecant(f,x1,x2, tol) Code to call your function 1 f=@(x) 1+x+2*x^3+sin(x)-exp(x); 2 MySecant(f,1,3,1-4)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
