MATLAB: How to know the new value of y after spline interpolation
interpolationspline
I usedcsaps() and assigned it into cs which is a structure that holdsbreaks (x-interpolated values),coefficients,order,dim, etc. But not the new value of y.
So how can I get this vector?
Best Answer
According to thecsaps documentation (part of the Curve Fitting toolbox), you can either usefnval:
pp = csaps(...)
yy = fnval(pp,xx)
or callcsaps itself with the new X values to get the new Y values:
Instead of getting confused, learn to read MATLAB's help, and learn how to browse the contents on the LHS of the page: it is arranged very nicely by topic.
‘Spline interpolation using not-a-knot end conditions. The interpolated value at a query point is based on a cubic interpolation of the values at neighboring grid points in each respective dimension.’
It does not appear to be the same as 'cubic'. According to the documentation, 'cubic' is currently the same as 'pchip'.
Best Answer