I\'m trying to write a cubic spline interpolation program. I have written the program but, the graph is not coming out correctly. The spline uses natural boundary conditions
There was a bug in spline function, generated (n-2) by (n-2) should be symmetric:
lower = h(2:end); main = 2*(h(1:end-1) + h(2:end)); upper = h(1:end-1);
http://www.mpi-hd.mpg.de/astrophysik/HEA/internal/Numerical_Recipes/f3-3.pdf