What is type of "Spline" function and how can I solve it mathematically to get coefficients?

1 次查看(过去 30 天)
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 个评论
Stephen23
Stephen23 2017-2-6
编辑:Stephen23 2017-2-6
"how can I solve it mathematically to get coefficients?"
You show us those coefficients, so they have clearly already been calculated. What is there left to "solve" ?

请先登录,再进行评论。

回答(1 个)

Stephen23
Stephen23 2017-2-6
编辑:Stephen23 2017-2-6
Why not read just the spline documentation?
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:

类别

Help CenterFile Exchange 中查找有关 Splines 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by