Cody

Problem 43637. For given vectors x,y find coresponding spline coefficients.

Solution 1855453

Submitted on 21 Jun 2019 by Evan
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x =[ -3 -2 0 2 3] y =[ 0 0 1 0 0] y_correct=[-3 -2 0 2 3]; assert(isequal(SplCoef(x,y),y_correct))

x = -3 -2 0 2 3 y = 0 0 1 0 0

2   Pass
x = 1:0.5:5 y =sin(x) y_correct=[ 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000 5.0000]; assert(isequal(SplCoef(x,y),y_correct))

x = 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000 5.0000 y = 0.8415 0.9975 0.9093 0.5985 0.1411 -0.3508 -0.7568 -0.9775 -0.9589