What is type of "Spline" function and how can I solve it mathematically to get coefficients?
1 view (last 30 days)
Show older comments
I used spline function to get cubic spline interpolating and coefficients, but I don't know how can I get these coefficients mathematically, and what is type of this spline(Natural or clamped or ...)? Can anyone help me, please?.
x=[0 1 .5 2 3];
y=[0 1 .5 2 1.5];
c = spline(x,y);
[breaks,coefs,l,k] = unmkpp(c)
coefs=
0.1667 -0.2500 1.0833 0
0.1667 -0.0000 0.9583 0.5000
-0.3333 0.2500 1.0833 1.0000
-0.3333 -0.7500 0.5833 2.0000
1 Comment
Answers (1)
Stephen23
on 6 Feb 2017
Edited: Stephen23
on 6 Feb 2017
The spline documentation says: "If x and Y are vectors of the same size, the not-a-knot end conditions are used."
You supplied two vectors of the same size, so I think you can figure out which spline curve it is.
If you want to know how to calculate spline coefficients yourself then look up an appropriate textbook or tutorial. This gives an overview of the MATLAB spline algorithms:
0 Comments
See Also
Categories
Find more on Splines in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!