Question: Exercise 2 Finding the Roots of a Cubic Function The polynomial has three real roots in the interval -4 to 4. You are required to

Exercise 2 Finding the Roots of a Cubic Function

The polynomial has three real roots in the interval -4 to 4. You are required to write two functions using Matlab: cubic_search, and cubic_bisection that do the following: 1. The cubic_search function accepts the function f(x) as a function handle, the interval of the search, the number of search intervals, and the stopping criterion . It should save the intervals that contain the three roots in a 3 x 2 array. This function is based on the incremental search bracketing method. 2. Once the intervals are found, the cubic_search function calls the cubic_bisection function to find the approximate roots using the bisection method. This function takes as an input the function f(x) as a function handle, the two initial points, and the stopping criterion = 0.0005. It displays the approximate root and the number of iterations needed to find this root within the required precision. Call this function as many times as needed. 3. What is the effect of changing the number of intervals from 10, to 50, to 100 on the results? 4. Use MATLAB built-in functions to find the approximate roots of f(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!