Results 1 to 9 of 9

Math Help - Cubic Spline

  1. #1
    Junior Member
    Joined
    Nov 2007
    Posts
    30

    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?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Forum Admin topsquark's Avatar
    Joined
    Jan 2006
    From
    Wellsville, NY
    Posts
    10,078
    Thanks
    375
    Awards
    1
    Quote Originally Posted by Atomic_Sheep View Post
    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
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Junior Member
    Joined
    Sep 2006
    From
    Between my ears
    Posts
    71
    Thanks
    12
    Wikipedia is usually a good starting point too:

    Spline interpolation - Wikipedia, the free encyclopedia
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Lord of certain Rings
    Isomorphism's Avatar
    Joined
    Dec 2007
    From
    IISc, Bangalore
    Posts
    1,465
    Thanks
    6
    Quote Originally Posted by Atomic_Sheep View Post
    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.
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Junior Member
    Joined
    Nov 2007
    Posts
    30
    Quote Originally Posted by Isomorphism View Post
    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.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by Isomorphism View Post
    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
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Lord of certain Rings
    Isomorphism's Avatar
    Joined
    Dec 2007
    From
    IISc, Bangalore
    Posts
    1,465
    Thanks
    6
    Quote Originally Posted by CaptainBlack View Post
    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
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Jan 2010
    Posts
    1

    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

    Quote Originally Posted by Isomorphism View Post
    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.
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Junior Member
    Joined
    Nov 2007
    Posts
    30
    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.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] Cubic Spline URGENT help!
    Posted in the Differential Geometry Forum
    Replies: 1
    Last Post: October 24th 2010, 01:47 PM
  2. Cubic Spline
    Posted in the Advanced Math Topics Forum
    Replies: 14
    Last Post: October 13th 2010, 10:26 AM
  3. Clamped Cubic Spline
    Posted in the Calculus Forum
    Replies: 1
    Last Post: March 26th 2010, 05:07 AM
  4. Cubic Spline Function
    Posted in the Differential Geometry Forum
    Replies: 1
    Last Post: October 22nd 2009, 04:31 AM
  5. How does one use Cubic Spline Interpolation?
    Posted in the Calculus Forum
    Replies: 7
    Last Post: May 23rd 2008, 01:42 PM

Search Tags


/mathhelpforum @mathhelpforum