How does a tensor product spline equation in MatLab code look like?

Hello,
can anyone help me to convert this equation :
into MatLab code, or provide me a comparable equation in MatLab code? I want to use this equation later on as "custom equation" in the "curve fitting tool". Thank you!

 採用された回答

Sachin Meena
Sachin Meena 2018 年 8 月 30 日

0 投票

Hi Lukas. If I understand your problem correctly, I believe the documentation link that you have provided contains your answer. In the section "B-form of Tensor Product Splines", the command given
Sp = spmat({s,t},a);
does what you are asking for. Here, the number vectors [m,n] are acquired from the size of "a", the coefficient matrix provided. With size of "s" and "t" known and the number vectors acquired, it also gets the orders vector [h,k].
So the equation is now in variable Sp.

6 件のコメント

Lukas Sohlbach
Lukas Sohlbach 2018 年 8 月 30 日
Hi Sachin,
thanks for your answer. I need an equation for this function of the curve fitting tool. The equation should fit in here:
Sachin Meena
Sachin Meena 2018 年 8 月 30 日
So you have "s", "t", "x", "y", and "z", and you need to find the coefficient matrix "a". Is that right?
Lukas Sohlbach
Lukas Sohlbach 2018 年 8 月 30 日
I just have data points in three vectors (x,y,z) which i loaded in the curve fitting tool. Now i want to fit a tensor product spline to this data points. The mathematical equation for a tensor product spline is shown in the my question. I need to convert this equation into a form MatLab (the curve fitting tool) can understand and work with.
Sachin Meena
Sachin Meena 2018 年 8 月 30 日
And what is the outcome that you are expecting from this? The knots sequence or the coefficient matrix?
Lukas Sohlbach
Lukas Sohlbach 2018 年 8 月 30 日
The coefficient matrix.
Sachin Meena
Sachin Meena 2018 年 8 月 31 日
Hey Lukas, it turns out that your use case is not yet supported by the cftool. The issue with using
spmat({s,t},a)
is that it does not explicitly uses "x" and "y", while the issue with using
spapi({s,t},[h,k],{x,y},z)
is that the dependent variable "z" cannot occur on both sides of the equation.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSpline Postprocessing についてさらに検索

製品

リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by