Matlab Database > Interpolation > Interpolation by Splines > CSPLINE

Matlab File(s)

Author: Rolf Krause
Institution: University of Bonn
Description: Cubic spline interpolation for given nodes x .
Two types of spline interpolation are available:
With given slopes at the endpoints:
y = [left_slope y_values right_slope] : given values
Without given slopes at the endpoints:
y = [y_values] : given values
xx - where to interpolate

usage: [a, b, c, d] = cspline(x,y,xx) or yy = cspline(x,y,xx)

See also the matlab-function SPLINE

x = 0:10; y = cos(x);
xx = 0:.25:10;
yy = cspline(x,y,xx);

Knowing the slopes at the endpoints, a better result can be obtained by

x = 0:10; y = cos(x);
xx = 0:.25:10;
yy = cspline(x,[-sin(xx(1)) y -sin(xx(end))],xx);
Keywords: ---
File Name: cspline.m
File Size: 3 KB
File Version: 1.0
Matlab Version: 6.1
Date: 1998-02-22
Downloads: 7341
Download File

Upload your own files today! Click here for more information.