Page 1 of 1

Example 4 Write a MATLAB function named root_finder that will take a table of values as inputs and finds all possible ro

Posted: Sat Mar 19, 2022 6:05 pm
by answerhappygod
Example 4 Write A Matlab Function Named Root Finder That Will Take A Table Of Values As Inputs And Finds All Possible Ro 1
Example 4 Write A Matlab Function Named Root Finder That Will Take A Table Of Values As Inputs And Finds All Possible Ro 1 (107.8 KiB) Viewed 39 times
Example 4 Write a MATLAB function named root_finder that will take a table of values as inputs and finds all possible roots of the underlying function for the range of data values given in the table. Which methods should you choose? Assume a tolerance of 10-4. Algorithm: First find the Lagrange polynomial from the data values. This is your f(x). Then use this function and a suitable root finding method Plot the original data points interpolated by the Lagrange polynomial and the roots on the same figure. Given Table: X 0 1 1 0.54 2 -0.42 3 -0.99 4 -0.66 5 0.28 6 0.96 7 0.75 8 -0.15 9 -0.91 10 -0.84 y Skeleton of the Function: function sol=root finder (tol,x,y) %tol-tolerance given %x=data values of x %y=data values of y end Save the function file as “root_finder.m’separately but in the same folder as the main script.