I have a series of values and times in an array. I want to create a spline fit wherein the derivative at every point that I give it is at zero. In short, I want to form a complex sinusoidal-looking wave from it. Each value should end up being either a local minimum or a local maximum. in the output. When I interpolate with the interp1
'spline' function, the first derivative at each given point is not zero. In reference to the code below, slopes1
should ideally equal to zero for t = [1 2 3 4 5 6 7 8 9 10]
. I hope that this makes sense.
If this is not possible with splines, then what would be the best approach to generate an oscillating curve with a series of minimums and maximums that are continuously 1st and 2nd order differentiable?
t=[1 2 3 4 5 6 7 8 9 10];
y=[1,-2,2,-1,6,-5,1,-1,8,-5];
pp = interp1(t,y,'spline','pp');
slopes1=ppval(pp_der,t);