%
%
%
% -----------------------------------------------------
%
%   Approximation  im  Wintersemester 2013/14
%   H.J. Oberle
%
%   Beispiel   
%   Spline-Interpolation der Funktion 
%   f(t) = 0, -5 <= t <= 5, t ne 0,
%   f(0) = 1 
%
% ----------------------------------------------------
%
function spline02(n)
%
close all
%
k = [0:1:n];
X = -5 + (10/n)*k;
Y = 0*X;
Y(n/2+1) = 1;
n = length(X) - 1;
%
p = spline(X,Y);
%
x = [-5:0.01:5];
s = ppval(p,x);
y = 0*x;
%
figure
plot(x,s,'b','Linewidth',1.2)
set(gca,'Linewidth',1.0,'FontSize',12)
axis([-5 5 -0.2 1.2])
hold
plot([-5 5],[0 0],'k--','Linewidth',1.2)
xlabel('Spline-Interpolation','FontSize',14)
plot(X,Y,'k.','Markersize',20)
hold off
%
%print -depsc spline02
%

