# Spline Construction

Create splines including B-form, tensor-product, NURBs, and other rational splines

Using the Curve Fitter app or the `fit` function, you can fit cubic spline interpolants, smoothing splines, and thin-plate splines. Other Curve Fitting Toolbox™ functions allow more specialized control over spline construction. For example, you can use the function `csapi` for cubic spline interpolation. For more information, see How to Construct Splines.

## Functions

 `bspline` Plot B-spline and its polynomial pieces `csape` Cubic spline interpolation with end conditions `csapi` Cubic spline interpolation `csaps` Cubic smoothing spline `cscvn` “Natural” or periodic interpolating cubic spline curve `franke` Franke's bivariate test function `getcurve` Interactive creation of cubic spline curve `ppmak` Put together spline in ppform `rpmak` Put together rational spline `rscvn` Piecewise biarc Hermite interpolation `rsmak` Put together rational spline for standard geometric shapes `spap2` Least-squares spline approximation `spapi` Spline interpolation `spaps` Smoothing spline `spcrv` Spline curve by uniform subdivision `splinetool` Experiment with some spline approximation methods `spmak` Put together spline in B-form `spterms` Explain spline terms `stmak` Put together function in stform `tpaps` Thin-plate smoothing spline `titanium` Titanium test data

## Topics

### Fitting Splines to Data

• Cubic Spline Interpolation
This example shows how to use the `csapi` and `csape` commands from Curve Fitting Toolbox™ to construct cubic spline interpolants.
• Cubic Smoothing Splines
This example shows how to use the `csaps` and `spaps` commands from Curve Fitting Toolbox™ to construct cubic smoothing splines.
• Fitting a Spline to Titanium Test Data
This example shows how to use commands from Curve Fitting Toolbox™ to fit a spline to titanium test data with manual and automatic selection of knots.

### Spline Applications

• Splines in the Plane
This example shows how to use the `spmak`, `spcrv`, `cscvn` and `rscvn` commands from Curve Fitting Toolbox™ to construct spline curves in the plane.
• Constructing Spline Curves in 2D and 3D
This example shows how to use the `cscvn` command from Curve Fitting Toolbox™ to construct cubic spline curves in two and three dimensions.
• Smoothing a Histogram
This example shows how to use spline commands from Curve Fitting Toolbox™ to smooth a histogram.
• Bivariate Tensor Product Splines
This example shows how to use the spline commands in Curve Fitting Toolbox™ to fit tensor product splines to bivariate gridded data.
• Solving a Nonlinear ODE with a Boundary Layer by Collocation
This example shows how to use spline commands from Curve Fitting Toolbox™ solve a nonlinear ordinary differential equation (ODE).
• Construct Chebyshev Spline
This example shows how to use commands from Curve Fitting Toolbox™ to construct a Chebyshev spline.