Homework 4
Due date: Dec. 29, 1998
For the following questions, you need to submit hardcopies of your programs,
together with the results returned by MATLAB.
- (20%)
Exercise P7.2 (page 201)
Note that:
- "n=2n" should be changed to "n=2k".
- Test your function on all five given functions, with k = 10.
- (20%)
Exercise P7.5 (page 201)
- (20%)
Exercise P7.6 (page 201)
- (20%)
Write a MATLAB script to generate the coefficients of the
Newton-Cotes formula when the polynomial order is 4.
Note that:
- You should know what Lagrange interpolation polynomials are before
attempting this question.
(If you don't, then it means that you've been skipping classes!)
- You should use the "polyfit" function to find
Lagrange interpolation polynomials.
- The correct answer is at the footnote of page 189.