Question: please add comments so I can understand and P1 and P3 must be of size [601 1]. Thank you Write a MATLAB function, called Lagrange-poly

please add comments so I can understand and P1 and P3 must be of size [601 1]. Thank you
Write a MATLAB function, called Lagrange-poly that inputs a set of data points (x,y)=(datx, daty), a set z of numbers at which to interpolate, and outputs the polynomial interpolant, y, evaluated at r using Lagrange polynomial interpolation. Your function header should look something like: 1. function y Lagrange-poly(x,datx, daty) = (a) Use the code you developed to interpolate the functions 1+z2 using the data points datx--3 : 1 : 3. Interpolate at the points x=-3: 0 . 01 : 3. Call Pl the La- grange interpolant of f. and P2 the Lagrange interpolant of /2. Repeat the experiment except using the data datxl--3:0.5:3. Call in that case P3 and P4 the new interpolants. Compare r answer for this problem to what you got previously. For each interpolation problem, plot on the same graph the function, the two interpolants, and the data set (use the function scatter). Comment the results in your matlab script using %
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
