Question: please thoroughly explain :) (a) Write a MATLAB .m function named bisection.m that computes a real root for any non- linear equation of the form
please thoroughly explain :)

(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 Lapprox. 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(2) is defined recursively as Pn+1(x) = 2xpr(2) Pn-1(1), where Po() =1, P1(x) = r. . It is known that pr(x) has n real roots, and all of them are located in the interval (-1, 1). Write a MATLAB code that plots a graph of the func- tion p4(2). By visually inspecting this plot, call the function bisection.m from part (a) in your code to numerically compute all 4 roots of p4(2) within tolerance = 10-4. Recall that bisection.m in turn calls appropriately defined func.m. 1 Executing your code 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
Get step-by-step solutions from verified subject matter experts
