Question: In this question you are asked to write a Matlab code that can do polynomial interpolation between the data points with given x & y
In this question you are asked to write a Matlab code that can do polynomial interpolation between the data points with given x & y coordinates. a) Use your program to draw a 3^rd order polynomial through the specified points. As discussed, a 3rd order polynomial requires 4 different data points. Generate the coordinates of the points in the manner shown in the table below such that x-coordinates are uniformly distributed between 0 and 1 and the y-coordinates are selected randomly. Find the coefficients of the 3^rd order polynomial and plot it. y = a_0 + a_1 x + a_2 x^2 + a_3 x^3 Your plot should look like as the one below. b) Run the same program with 6 points and calculate the coefficients of the 5th order polynomial going exactly through the 6 data points with the green coordinates. c) Fit a linear function through data points generated in b). The linear function will not go exactly through the data points but it will be pass "nearby" the points in a sense that the error is minimized. To generate it use the "polyfit" function available in Matlab library Information about the usage of this function can be found in Matlab's help
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
