Question: In order to do problem 2, 1 has to be completed Write a MATLAB function, called Lagrange_poly that inputs a set of data points (x;

 In order to do problem 2, 1 has to be completed

In order to do problem 2, 1 has to be completed

Write a MATLAB function, called Lagrange_poly that inputs a set of data points (x; y) =(datx, daty), a set x of numbers at which to interpolate, and outputs the polynomial interpolant, y, evaluated at x using Lagrange polynomial interpolation. Your function header should look something like: function y = Lagrange_poly(x, datx, daty) Use the code you developed in Problem 1 to interpolate the functions f(x) = e^-x^2 f(x) = 1/1 + x^2 using the data points datx=-5:1:5. Interpolate at the points x=-5:0.001:5. Plot the results and comment on the error

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!