This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: worth it becomes. This famous example is due to Carl Runge. Let x , x 1 , . . . , x n be n + 1 equally spaced points between-5 and 5 (with x =-5 and x n = 5). Write a matlab code to compute and plot the unique polynomial p n ( x ) of degree ≤ n which interpo-lates f ( x ) on these n + 1 points. You will need to use the divided diﬀerence algorithm and the nested evaluation for polynomial that you have seen during the discussion. Do it for n = 2 , n = 4 , n = 6 , n = 10 , n = 14 , n = 30 You should provide one matlab code (not 6) and 6 plots. On each plot, I want to see both f ( x ) and p n ( x ). Also the node points ( x i , f ( x i )) should be marked by a cross. (see next page for an example of what your plot should look like. Do ’help plot’ if you don’t know how to do it). 1-5-4-3-2-1 1 2 3 4 5-0.5 0.5 1 1.5 2 inter. poly. of degree 10 f(x) node points 2...
View Full Document
This note was uploaded on 10/28/2010 for the course MATH 135A taught by Professor Thomas during the Spring '10 term at UC Riverside.
- Spring '10