cubic_spline_natural

3 visualizaciones (últimos 30 días)
BUTHOLEZWE MBANGENI
BUTHOLEZWE MBANGENI el 19 de Sept. de 2017
Respondida: David Ding el 27 de Sept. de 2017
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'.

Respuestas (1)

David Ding
David Ding el 27 de Sept. de 2017
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

Categorías

Más información sobre Splines en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by