Hi, I am trying to manually create a natural cubic spline in Matlab without using the built in spline function. The test problem has 3 spans (4 control points), and I am keeping it general enough so that it can handle unequally spaced points.
Ultimately, I want to extract interpolated values within each span but am having difficulty in getting the code right. Can anyone with expertise in this area shed some light on what I'm doing wrong with the below code please? Thanks a lot.
%program to simulate spline behaviour for 3 spans % Control point coordinates x(1) = 1; x(2) = 6; x(3) = 11; x(4) = 16;