Table Of Contents

spline

Version:
    Last Modified: March 15, 2017

    Computes the cubic spline interpolation of the input data.

    Syntax

    pp = spline(x, y)
    yy = spline(x, y, xx)

    Inputs

    x

    Vector.

    y

    Vector, matrix, or n-dimensional array. If you use the syntax spline(x, y), y can be real or complex. If you use the syntax spline(x, y, xx), y must be real. If the last dimension of y has the same length as x, MathScript adapts not-a-knot end conditions. If the last dimension of y has two more elements than x, MathScript uses the first and last elements of y as the end slopes for the cubic spline.

    xx

    New abscissa. xx is a vector, matrix, or n-dimensional array.

    Outputs

    pp

    Piecewise polynomial form of the cubic spline interpolant.

    yy

    Values of a piecewise polynomial corresponding to xx.

    X = 0:6;
    Y = [pi/2, 0, 1, 0, -1, 0, pi/2];
    XX = 0:0.1:6;
    YY = spline(X, Y, XX);
    plot(X, Y, 'o', XX, YY, '-')

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics