フィルターのクリア

How to construct cubic splines?

1 回表示 (過去 30 日間)
Momo
Momo 2018 年 2 月 24 日
編集済み: Momo 2018 年 2 月 27 日
Hello, I am trying to implement the following code in Matlab but it dose not work.
x = 2*pi*[0 1 .1:.2:.9];
y = cos(x);
csp = csape( x, y, 'periodic' );
hold on
fnplt(csp,'g')
hold off

採用された回答

John D'Errico
John D'Errico 2018 年 2 月 24 日
編集済み: John D'Errico 2018 年 2 月 24 日
Do you have the curve fitting toolbox? CSAPE is part of that TB. (It used to be in the splines TB but that got merged into the curve fitting TB some years ago.)
My SLM toolbox (found on the file exchange) does allow periodic boundary conditions.
x = 2*pi*[0:.1:1];
y = cos(x);
SLM = slmengine(x,y,'knots',x,'endcond','periodic','regul',0,'result','pp','plot','on');
So a purely interpolating cubic spline, with periodic boundary conditions.
  2 件のコメント
John D'Errico
John D'Errico 2018 年 2 月 24 日
編集済み: John D'Errico 2018 年 2 月 24 日
At the command line, use the ver command. If you have that TB, you will see it listed. So, for me, I see this:
ver
...
Curve Fitting Toolbox Version 3.5.6 (R2017b)
John D'Errico
John D'Errico 2018 年 2 月 25 日
Works fine for me. Don't you hate that? ;-)
x = 2*pi*[0 1 .1:.2:.9];
y = cos(x);
csp = csape( x, y, 'periodic' );
fnplt(csp,'g')
Your release is only slightly older than mine, which should not be a problem.
Perhaps you have hurt the feelings of your computer recently? Try giving it flowers? My computer can hold a grudge. Ok. Only kidding.
Seriously, can you use the other tools from the curve fitting toolbox? If not, then you might have an installation problem with that toolbox. I'd check to see if there were corruption problems on your disk. Maybe try re-installing MATLAB from online - that is pretty quick with a fast connection.
I just looked at the release notes, but do not see any recent changes to csape.
Is the CFT in your search path? So while you have a license, perhaps your search path got screwed up?

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

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by