Test your code on the data set:
t y
--------------
-1.0 0
-0.5 2.0
0 0
0.5 -4.0
1.0 1.0
Use
. Find v.
Save [t,y] and [x,v] in ascii files.
In MATLAB load the result files and plot the data and the obtained values:
plot(t,y,'o',x,v)
legend('Data','Spline')
print -deps spl.eps