Question: PLEASE ANSWER USING MATLAB ONLY AND INLCUDE SCREENSHOTS OF COMMAND/EDITOR WINDOW! 3.16 Write a MATLAB user-defined function that solves for a root of a nonlinear
PLEASE ANSWER USING MATLAB ONLY AND INLCUDE SCREENSHOTS OF COMMAND/EDITOR WINDOW!

3.16 Write a MATLAB user-defined function that solves for a root of a nonlinear equation f(x) 0 using the bisection method. Name the function xs = Bi sectio nRoot(Fun, a, b). The output argument Xs is the solution. The input argument Fun is a name for the function that calculates f(x) for a given x (it is a dummy name for the function that is imported into BisectionRoot); a and b are two points that bracket the root. The iterations should stop when the tolerance in f(x) (Eq. (3.5) is smaller than 0.000001. The program should check if points a and b are on opposite sides of the solution. If not, the program should stop and display an error message. Use BisectionRoot to solve Problem 3.2 Tolerance!nf = Equation 3.5 -> 3.2 Determine the root of f(x) - x-2e* by: (a) Using the bisection method. Start with a -0 and b-1, and carry out the first three iterations. (b) Using the secant method. Start with the two points, x-0 and x2-1, and carry out the first three iter ations. (c) Using Newton's method. Start at x,1 and carry out the first three iterations
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
