File Exchange

image thumbnail


version 1.0.0 (238 KB) by Jonas Lundgren
Fit a spline to noisy data


Updated 16 Apr 2019

View License

Direct spline interpolation of noisy data may result in a curve with
unwanted oscillations. This is particularly bad if the slope of the
curve is important.

A better approach is to reduce the degrees of freedom for the spline
and use the method of least squares to fit the spline to the noisy
data. The deegres of freedom are connected to the number of breaks
(knots), so the smoothing effect is controlled by the selection of

- A curve fitting tool based on B-splines
- Splines on ppform (piecewise polynomial)
- Any spline order (cubic splines by default)
- Periodic boundary conditions
- Linear constraints on function values and derivatives
- Robust fitting scheme
- Operates on ND arrays in the same way as SPLINE
- Nonuniform distributions of breaks

examples - Examples for splinefit
ppdiff - Differentiate piecewise polynomial
ppint - Integrate piecewise polynomial

Cite As

Jonas Lundgren (2019). SPLINEFIT (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.

Learn About Live Editor