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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 38 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply