Cubic Spline Fit-Just confirm the code

Asked by manish sharma on 11 Jul 2012
Latest activity Commented on by manish sharma on 12 Jul 2012

Hi,

I have two vectors, X, and Y (of same size).

Now, I am interested in cubic spline fit of the data points (Y) at certain values (let's call this vector as "x") by the code:

-------------------------------

x = 1:1:125;

y = interp1(X,Y, x,'spline')

plot(x,y,'--r')

-------------------------------

PLEASE CONFIRM:

The "plot (x,y,'--r')" command will give the cubic spline fit for data points (represented in Y), right?

0 Comments

manish sharma

Products

No products are associated with this question.

1 Answer

Answer by John Petersen on 11 Jul 2012
Accepted answer

right. You can verify this by

plot(X,Y,,'.',x,y);legend('Samples','Spline')

1 Comment

manish sharma on 12 Jul 2012

Thanks John!

John Petersen

Contact us