1 2 / 2 / 2 (a) | -3x (b) | -3x | e dx , | e dx . / / -1 0
x + x + x = 6 1 2 3 2x - x + 2x = 6 1 2 3 3x + 2x - x = 4 1 2 3
_ _ | | | | 1 0 1 | 7 | | | | | 0 0 3 | 9 | | | | | 0 2 1 | 5 | |_ | _|
T ( x x x ) 1 2 3using back substitution.
_ _ | | | 3 0 3 | | | A = | 0 -1 3 | | | | 1 3 0 | |_ _|
[a,b]
with n+1
knots
a = t < t < t < ... < t = b. 0 1 2 n
[a,b]
?
x = 0:4; y = [3 1 0 2 4]; xx = 0:0.5:4; yy = spline(x,y,xx); plot(x,y,'o',xx,yy,'x'); axis([0 4 -1 4]); xlabel('x'); ylabel('y'); title('Cubic Spline Interpolation');