Question: Question 2 (5 Marks) Let f(x) cos(x) , take 6 sample points from f(x) at x- 0 : 0 . 5 *p1: p1+2 . 5,

Question 2 (5 Marks) Let f(x) cos(x) , take 6 sample points from f(x) at x- 0 : 0 . 5 *p1: p1+2 . 5, calculate y value for each x. Using x and y da (a) construct and plot a free cubic spline with zero second derivatives at two ends using user- defined function cubic_spline_natural; (b) construct and plot a clamped cubic spline with the real values of the first derivatives at two ends user-defined function cubic spline clamped c construct and plot a not-a-knot cubic spline user-defined codes cubic spline notaknot b) and Ce) using MATLAB fiunction spline.Plot your results (e) Repeat the step (c) and interpolate a linear spline using MATLAB function interp1. Plot your results. olution
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
