Question: Please solve c and d using Matlab. Thank you Problem 2 Use MATLAB to generate 7 equally spaced data points from Runge's function: f(x)- 1+25x2
Please solve c and d using Matlab. Thank you Problem 2 Use MATLAB to generate 7 equally spaced data points from Runge's function: f(x)- 1+25x2 on the interval -1 Sxs1. Use these 7 data points to generate an interpolated approximation of the function fx) forx [-1:0.01:1] using: a) A 6h order polynomial. b) A linear spline. e) A cubic spline with derivative end conditions equal to the exact values of the derivative calculated analytically. d) A cubic spline with "not-a-knot" end conditions For each case, calculate the relative error (a) for every value of x ANSWERS: Save your results for (a), (b), (c), and (d) as column vectors (201x1) and write to A5.dat, A6.dat, A7.dat and A8.dat respectively. Save your & results to a matrix (201x4) with the error results for (a) in the first column, the results for (b) in the second column, the results for (c) in the third column and the results for (d) in the fourth column and write this matrix to A9.dat
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
