Question: Develop a Matlab function that finds the root of a function f(x) within a given initial interval [a, b] with a tolerance in solution of

 Develop a Matlab function that finds the root of a function

Develop a Matlab function that finds the root of a function f(x) within a given initial interval [a, b] with a tolerance in solution of at least e using the bisection method. Name the function myBisect using as input the anonymous function f (see page 530 of the text book on how to use anonymous functions), the lower bound a and upper bound b of the initial interval, and eps the required tolerance in solution. As output, the function should provide five scalar variables: the numerical solution, its tolerance in solution, its tolerance in function, its estimated relative error, and the number of iterations performed. If the initial interval [a, b] does not contain a root, the function should display an error message and exit. Calculate the number of required iterations by using the fact that the bisection method halves the tolerance in solution with each iteration. Use the Matlab function ceil to round to the next larger integer when calculating the number of required iterations. You can debug your function using the first 3 iterations of problem la)

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!