1. ## Cubic Spline

I've got a few questions related to fitting cubic splines to data.

1.) how is it done? I know you can do it in matlab but how is it done in matlab? In other words i'm interested in how matlab as a program does it and not the process of doing them in matlab as you would find in the matlab manual.

2.) what is the implication of having 2 or 3 or more points in your data that are on the same level... how does a cubic spline fit over those?

2. Originally Posted by Atomic_Sheep
I've got a few questions related to fitting cubic splines to data.

1.) how is it done? I know you can do it in matlab but how is it done in matlab? In other words i'm interested in how matlab as a program does it and not the process of doing them in matlab as you would find in the matlab manual.

2.) what is the implication of having 2 or 3 or more points in your data that are on the same level... how does a cubic spline fit over those?
Here's a brief explanation of how it's done in general. Mathlab might have a few numerical algorithms embedded in it to make the solution easier for it.

-Dan

3. Wikipedia is usually a good starting point too:

Spline interpolation - Wikipedia, the free encyclopedia

4. Originally Posted by Atomic_Sheep
I've got a few questions related to fitting cubic splines to data.

1.) how is it done? I know you can do it in matlab but how is it done in matlab? In other words i'm interested in how matlab as a program does it and not the process of doing them in matlab as you would find in the matlab manual.

2.) what is the implication of having 2 or 3 or more points in your data that are on the same level... how does a cubic spline fit over those?
Are you still on it? Do you still have doubts with it?
I wrote a spline function that imitates MATLAB's not too long ago.
You can check the mathworks site, goto cleve moler's page. He has fully described the cubic splines in a neat way.
I believe MATLAB uses both clamped and Natural as inputs.

5. Originally Posted by Isomorphism
Are you still on it? Do you still have doubts with it?
I wrote a spline function that imitates MATLAB's not too long ago.
You can check the mathworks site, goto cleve moler's page. He has fully described the cubic splines in a neat way.
I believe MATLAB uses both clamped and Natural as inputs.
No not really on it at the moment with christmas and new years and all that... in a different city at the moment... had a quick look though and looks interesting will surely give it a closer inspection when I get home thanks for the link and have a happy new year.

6. Originally Posted by Isomorphism
Are you still on it? Do you still have doubts with it?
I wrote a spline function that imitates MATLAB's not too long ago.
You can check the mathworks site, goto cleve moler's page. He has fully described the cubic splines in a neat way.
I believe MATLAB uses both clamped and Natural as inputs.
It is generaly usefull to give a link or the URL when refering to something
on the net.

Also Cleve's book Numerical Computing with MATLAB is available on
line at:

The MathWorks - Numerical Computing with MATLAB by Cleve Moler

and the chaper relevant to this question at:

Chapter 3 Interpolation

RonL

7. Originally Posted by CaptainBlack
It is generaly usefull to give a link or the URL when refering to something on the net.
I generally do, but I was not sure if the poster wanted it(since the thread was old) and I was in a hurry that day

8. ## Matlab equivalent cubic spline

Isomorphism,

Were you able to immitate the Matlab implementation in c/c++? or did you follow the book 'A practical guide to Splines' to come up with the implementation?

I have a need in my project to develop c++ equivalent of Matlab cubic spline functionality. I don't have the book right now, but I'm trying to judge what is the best route I should take!

Has anyone else had the experience in implementing the cubic spline functionality?

Thanks

Originally Posted by Isomorphism
Are you still on it? Do you still have doubts with it?
I wrote a spline function that imitates MATLAB's not too long ago.
You can check the mathworks site, goto cleve moler's page. He has fully described the cubic splines in a neat way.
I believe MATLAB uses both clamped and Natural as inputs.

9. Not quite sure, whether we are on the same page but I found some good resources out there demonstrating various spline methods that I think are easy enough to code in C++. I think you will be able to find code for it already done and publicly available if you look around anyway.