Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are not allowed to use MATLAB built-in functions polyfit, polyval, and spline. 2. (14 points) (Programming by MATLAB) Let f(x) = 1/(1+ 25x2). (b)
You are not allowed to use MATLAB built-in functions polyfit, polyval, and spline.
2. (14 points) (Programming by MATLAB) Let f(x) = 1/(1+ 25x2). (b) Using 7 Chebyshev nodes Xi = COS 2i +1 T 2n + 2 i= 0,1,..., n, n= 6 i. find the interpolating polynomial p(x) of degree 6 for f(x) by the Newton approach. ii. find the natural cubic spline function S(x) to interpolate f(x). iii. find the function g(x) = a + bx2 + cx4 to approximate f(x) by the least squares method. Print the coefficients of p(x), S(x) and g(x). Print the four values f(x), f(x) p(x), f(x) S(x), and f(x) g(x) at 13 equally spaced points I; = -1+(1/6)i for i = 0,1,...,12. Plot y = f(x), y = p(x), y = S(x) and y = g(x) on the same plot. 2. (14 points) (Programming by MATLAB) Let f(x) = 1/(1+ 25x2). (b) Using 7 Chebyshev nodes Xi = COS 2i +1 T 2n + 2 i= 0,1,..., n, n= 6 i. find the interpolating polynomial p(x) of degree 6 for f(x) by the Newton approach. ii. find the natural cubic spline function S(x) to interpolate f(x). iii. find the function g(x) = a + bx2 + cx4 to approximate f(x) by the least squares method. Print the coefficients of p(x), S(x) and g(x). Print the four values f(x), f(x) p(x), f(x) S(x), and f(x) g(x) at 13 equally spaced points I; = -1+(1/6)i for i = 0,1,...,12. Plot y = f(x), y = p(x), y = S(x) and y = g(x) on the same plotStep 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