Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations GregLocock on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cubic Spline

Status
Not open for further replies.

andreasmalta

Mechanical
Apr 26, 2016
1
I need to fit a cubic spline to a sequence of N knots (xi, yi), 1 < i < N

My xi are are distinct, in ascending order but not necessarily equally spaced. I need to write a program in Matlab to solve for the curvatures si.

Can anyone can help me on how to go around in solving this.
 
Replies continue below

Recommended for you

Is this for school? Student posting is not allowed.

TTFN
I can do absolutely anything. I'm an expert!
faq731-376 forum1529
 
Matlab has a Spline Toolbox. You don't fit a spline to knots, you fit it to an N-Dim set of raw data points. The knots are locations where the (cubic in your case) fitting equations are joined. No need to have ascending order either.

It's a least squared error type solution. Endpoints match, derivatives at endpoints match.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor