Question: (a) Write a MATLAB .m function named bisection.m that computes a real root for any non- linear equation of the form f(x) = 0 within

 (a) Write a MATLAB .m function named bisection.m that computes a

(a) Write a MATLAB .m function named bisection.m that computes a real root for any non- linear equation of the form f(x) = 0 within numerical tolerance e, where f is continuous in the interval [a, b]. Your MATLAB function bisection.m should take the inputs: a,b, f,e and return an approximation for the root X approx. It is a good practice (but not mandatory) to pass an additional input for maximum number of iterations. The function f should be defined in another MATLAB function func.m. (b) For any nonnegative integer n, the function Pn(x) is defined recursively as Pn+1(x) = 2xpn(x) Pr-1(x), where Po(L) = 1, p1(x) = x. It is known that Pn(x) has n real roots, and all of them are located in the interval (-1,1). Write a MATLAB code Yourlastname 1. m that plots a graph of the func- tion p4(x). By visually inspecting this plot, call the function bisection.m from part (a) in your code Yourlastname .m to numerically compute all 4 roots of p4(x) within tolerance E = 10-4. Recall that bisection.m in turn calls appropriately defined func.m. Executing your code Yourlastname 1.m should generate a plot of p4(2), AND print its 4 real roots approximated via bisection method in MATLAB command window. Hint for part (b): Before you code, use hand calculation to first derive p4() as a function of X. You don't need to show/submit your hand calculations

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!