Question: These questions in Numerical Analysis. Could you please make sure the code for Matlab is working? Thanks. ( 1 ) ( MATLAB: Lagrange interpolation )
These questions in Numerical Analysis.
Could you please make sure the code for Matlab is working? Thanks. MATLAB: Lagrange interpolation
We consider the function on the interval
a Implement a MATLAB function that compute the interpolating Lagrange polynomial
of degree on equally spaced nodes you can use the function polyfit and
polyval Plot the graph of and the interpolating polynomials on the same figure use
sample points to evaluate and the Lagrange polynomial Comment your result.
b Explain briefly why can we use the MATLAB command polyfit to find Lagrange
interpolating polynomial.
MATLAB natural cubic spline
a Implement a MATLAB function called natural cubic spline that has the form:
xout, yout n aturalcubicspline xy nsample
where the vectors and represents the nodes and data the integer nsample is the
number of sampling points in each interval use the command linspace to
generate them The function returns a vector xout with the coordinate of the sampling
point and a vector yout with the value of the natural cubic spline at the sampling points.
b Create a MATLAB script that use the above function with
for dots, and Plot the output in a graph. Any comment compares to the
results you got in question a
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
