Question: Write a Matlab function that computes the linear spline interpolation for a given data set. You might need to take a look at the file

Write a Matlab function that computes the linear spline interpolation for a given data set. You might need to take a look at the file cspline_eval.m in Section 3.4 for some hints. Name your Matlab function lspline . This can be defined in the file lspline.m , which should begin with: function ls=lspline(t,y,x)

% lspline computes the linear spline

% Inputs:

% t: vector, contains the knots

% y: vector, contains the interpolating values at knots

% x: vector, contains points where the lspline function

% should be evaluated and plotted

% Output:

% ls: vector, contains the values of lspline at points x

Use your Matlab function lspline on the given data set in Problem 2, plot the linear spline for the interval [1 . 2 , 2 . 2].

What to hand in: Hand in the Matlab file lspline.m , and your plots.

Write a Matlab function that computes the linear spline interpolation for a

Your task. Write a Matlab function that computes the linear spline interpolation for a given data set. You might need to take a look at the file cspline_eval.m in Section 3.4 for some hints. Name your Matlab function lspline. This can be defined in the file 1spline.m, which should begin with function ls-lspline (t,y,x) % |spline computes the linear spline % inputs: t: vector, contains the knots %y: vector, contains the interpolating values at knots %x: vector, contains points where the lspline function should be evaluated and plotted % Output: % 1s: vector, contains the values of lspline at points x Use your Matlab function 1spline on the given data set in Problem 2, plot the inear spline for the interval 1.2,2.2. What to hand in: Hand in the Matlab file 1spline.m, and your plots

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!