Import data to splinetool create spline with function

2 ビュー (過去 30 日間)
Gavin Seddon
Gavin Seddon 2017 年 8 月 15 日
コメント済み: Gavin Seddon 2017 年 8 月 23 日
Hello, initially I created a spline with cftool. Is it possible to import the same data to splinetool and generate the function? GS.
  1 件のコメント
Gavin Seddon
Gavin Seddon 2017 年 8 月 16 日
Hello, I should mention that I only want to provide evidence of a trigonometric spline so it is mainly importing data and if possible some evidence sine or cosine being used in the knot. GS.

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

採用された回答

Faiz Gouri
Faiz Gouri 2017 年 8 月 17 日
I understand that you have created a spline using 'cftool' and would like to use the same in 'splinetool'. You can do so by taking a function handle and use it in 'splinetool' An example follows: You can construct a cubic spline interpolant that matches the cosine function at the following sites x, using the csapi command.
x = 2*pi*[0 1 .1:.2:.9];
y = cos(x);
cs = csapi(x,y);
You can then view the interpolating spline by using fnplt and get its handle-
h = fnplt(cs,2);
Now, you can use 'h' in 'splinetool' when it prompts you to import your own data.
Hope this helps!
  3 件のコメント
Gavin Seddon
Gavin Seddon 2017 年 8 月 21 日
Yes this works, thank you.
Gavin Seddon
Gavin Seddon 2017 年 8 月 23 日
Is it possible to use all the x data from a table for input to this ? GS.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpline Postprocessing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by