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

1 回表示 (過去 30 日間)
Nour Khashan
Nour Khashan 2017 年 2 月 6 日
編集済み: Stephen23 2017 年 2 月 6 日
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 Center および File ExchangeSplines についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by