Question: Please solve by writing a Matlab code and show what the code is by typing it into the window in Matlab thanks Problem 2 Use
Please solve by writing a Matlab code and show what the code is by typing it into the window in Matlab thanks Problem 2 Use MATLAB to generate 7 equally spaced data points from Runge's function: f(x)= 1+25x2 on the interval -1 sr1. Use these 7 data points to generate an interpolated approximation of the functionfx) forx--1:0.01:1] using: a) A 6th order polynomial. b) A linear spline. c) 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
