Member of the approximation and the resampling classes.
yy = spline(x, y, xx)
Computes the cubic spline interpolation of the input data.
| Name | Description |
| x | Specifies a vector. |
| y | Specifies a real or complex vector. If y has the same length as x, LabVIEW adapts not-a-knot end conditions. If y has two more elements than x, LabVIEW uses the first and last elements of y as the end slopes for the cubic spline. y also can be a matrix that represents a vector-valued piecewise polynomial. In this case, each column of y represents the value of one point. |
| xx | Specifies the new abscissa. xx is a vector. |
| Name | Description |
| yy | Returns the values of a piecewise polynomial corresponding to xx. yy is a vector. |
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)
YY = spline(0:4, [0, 1, 0, -1, 0, 1, 0; pi/2, 0, 1, 0, -1, 0, pi/2], 0:0.1:4)