cubic_spline_natural

3 ビュー (過去 30 日間)
BUTHOLEZWE MBANGENI
BUTHOLEZWE MBANGENI 2017 年 9 月 19 日
回答済み: David Ding 2017 年 9 月 27 日
x = [2 2.5 3 4 5 6.5 8]; y = [3 -1 3 -4 0 3 2]; Given this data use cubic_spline_natural function to construct and plot a free cubic spline with zero second derivative at two ends I tried this code below but I keep getting
xx= linspace(2,8); m = length(xx); yy=zeros(1,m); for i = 1:m; yy(i)= cubic_spline_natural(x,y,0.0,0.0,xx(i)); end Undefined function or variable 'cubic_spline_natural'. variable 'cubic_spline_natural'.
xx= linspace(2,8); m = length(xx); yy=zeros(1,m); for i = 1:m; yy(i)= cubic_spline_natural(x,y,0.0,0.0,xx(i)); end Undefined function or variable 'cubic_spline_natural'.
yyy(i)= cubic_spline_natural(x,y,0.0,0.0,xx(i)); Undefined function or variable 'cubic_spline_natural'.

回答 (1 件)

David Ding
David Ding 2017 年 9 月 27 日
Do:
>> which cubic_spline_natural
If the output is:
'cubic_spline_natural' not found.
Then likely you did not define this function in the first place. If this is the case, you need to write this function as it is not a MATLAB built-in function.
However, if you did, make sure that it resides in the current working directory or add the directory containing this function in your working path.
Thanks,
David

カテゴリ

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