Question: Create a MATLAB function named lagrange.interp.m to perform interpolation using Lagrange polynomials. Download the template for function lagrange.interp.m. The tem plate is in homework 5

 Create a MATLAB function named lagrange.interp.m to perform interpolation using Lagrangepolynomials. Download the template for function lagrange.interp.m. The tem plate is in

Create a MATLAB function named lagrange.interp.m to perform interpolation using Lagrange polynomials. Download the template for function lagrange.interp.m. The tem plate is in homework 5 folder on TritonED. The function takes in the data at nodes, xi and yi, as well as the target x value. The function returns the interpolated value y. Here, xi and yi are vectors while x and y are scalars. You are not required to follow the template; you can create the function in your way. The formula for Lagrange interpolation is given as follows: where n is the degree of the polynomials and L() are cardinal functions defined as follows: Use function lagrange.interp.m and the seawater temperature data in table 1 to perform the following exercises. (a) Estimate the temperature at depth z =-150 m using nodes 4 through 6- Put the (b) Estimate the temperature at depth z150 m using nodes 4 through 7. Put the (c) Estimate the temperature at depth z--150 ml using all nodes. Put the answer in answer in p4a. answer in p4b. p4c Create a MATLAB function named lagrange.interp.m to perform interpolation using Lagrange polynomials. Download the template for function lagrange.interp.m. The tem plate is in homework 5 folder on TritonED. The function takes in the data at nodes, xi and yi, as well as the target x value. The function returns the interpolated value y. Here, xi and yi are vectors while x and y are scalars. You are not required to follow the template; you can create the function in your way. The formula for Lagrange interpolation is given as follows: where n is the degree of the polynomials and L() are cardinal functions defined as follows: Use function lagrange.interp.m and the seawater temperature data in table 1 to perform the following exercises. (a) Estimate the temperature at depth z =-150 m using nodes 4 through 6- Put the (b) Estimate the temperature at depth z150 m using nodes 4 through 7. Put the (c) Estimate the temperature at depth z--150 ml using all nodes. Put the answer in answer in p4a. answer in p4b. p4c

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!