Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribedimage text in transcribedimage text in transcribed

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 plot

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Financial Management For Nurse Managers Merging The Heart With The Dollar

Authors: J. Michael Leger

5th Edition

1284230937, 9781284230932

More Books

Students also viewed these Finance questions

Question

What are the advantages and disadvantages of flextime?

Answered: 1 week ago

Question

What could Kathy have done to keep the situation from occurring?

Answered: 1 week ago

Question

How can Seaview improve their benefits communication? Discuss.

Answered: 1 week ago