TSTOOL home page | TSTOOL documentation page | TSTOOL installation page | TSTOOL link page

Next: 6.2 amutual - compute Up: 6. Mex-Function Reference Previous: 6. Mex-Function Reference

# 6.1 `akimaspline` - Cubic spline interpolation using Akima splines

Compared to Matlab's built-in cubic spline, Akima spline interpolation better copes with discontinuities in a time series.

Syntax:

- `yy = akimaspline(x,y,xx)`

Input arguments:

- `x`, `y` - vectors describing knot data, see Matlab's original spline function
- `xx` - vector of positions at which the spline is evaluated

Output arguments:

- `yy` - evaluated function values

Example:

    x = 1:100;
    y = floor((x + rand(1, 100))/ pi);
    xx = 1:0.1:100;
    yy = akimaspline(x, y, xx);
    plot(x,y, xx, yy, 'r')