Answered step by step
Verified Expert Solution
Question
1 Approved Answer
WRITE A MATLAB CODE 1. Interpolation [25] In the following problem you will use different interpolation techniques and see their advantages/disadvantages. Consider the function 1
WRITE A MATLAB CODE
1. Interpolation [25] In the following problem you will use different interpolation techniques and see their advantages/disadvantages. Consider the function 1 + x2 This is known as Runge's example. a) Plot the function using MATLAB in the interval -5 to 5 with 100 equidistant points.[5 b) Now evaluate the function in 16 equidistant points in the same interval and plot the points using the scatter command. When you plot, use hold on to plot in the same figure. [5 Make full polynomial interpolation of the dataset with 11 points and plot the polynomial in the same plot. Comment the result! c) d) Now use cubic spline (standard MATLAB spline) to make piecewise interpolation of the dataset with 11 data points. Plot the error i.e. the difference between the spline result and the actual function in given interval. Comment on the result! e) Using the command fminbnd, find for which value of x is the biggest error in spline interpolation! 1. Interpolation [25] In the following problem you will use different interpolation techniques and see their advantages/disadvantages. Consider the function 1 + x2 This is known as Runge's example. a) Plot the function using MATLAB in the interval -5 to 5 with 100 equidistant points.[5 b) Now evaluate the function in 16 equidistant points in the same interval and plot the points using the scatter command. When you plot, use hold on to plot in the same figure. [5 Make full polynomial interpolation of the dataset with 11 points and plot the polynomial in the same plot. Comment the result! c) d) Now use cubic spline (standard MATLAB spline) to make piecewise interpolation of the dataset with 11 data points. Plot the error i.e. the difference between the spline result and the actual function in given interval. Comment on the result! e) Using the command fminbnd, find for which value of x is the biggest error in spline interpolationStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started