cubicSplinePredict(model, x)


model is a dictionary with two keys, c and x. The value of c is the coefficients of the polynomials on each segment, and the value of x is the polynomial breakpoints. The length of c is equal to (the length of x -1)*4. Neither c nor x can contain NULL values. The model can be obtained with function cubicSpline.

x is a numeric scalar or vector containing the independent variable to be predicted.


Predict the corresponding y for x with the given model.


n = 10
x = 0..(n-1)
y = sin(x)
model = cubicSpline(x, y, bc_type="not-a-knot")

newx = [-0.5, 0.5, 0.7, 1.2, 4.5, 8.9, 9.3]
ret = cubicSplinePredict(model, newx)

// output

Related Function: cubicSpline