cubic_spline_natural
조회 수: 3 (최근 30일)
이전 댓글 표시
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'.
댓글 수: 0
답변 (1개)
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
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Splines에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!