introducing spline fitting -凯发k8网页登录

main content

introducing spline fitting

spline overview

the curve fitting toolbox™ spline functions are a collection of tools for creating, viewing, and analyzing spline approximations of data. splines are smooth piecewise polynomials that you can use to represent functions over large intervals, where it would be impractical to use a single approximating polynomial.

the spline functionality includes a tool that provides easy access to functions for creating, visualizing, and manipulating splines. the toolbox also contains functions that enable you to evaluate, plot, combine, differentiate, and integrate splines. because all toolbox functions are implemented in the open matlab® language, you can inspect the algorithms, modify the source code, and create your own custom functions.

key spline features:

  • tools that let you create, view, and manipulate splines and manage and compare spline approximations

  • functions for advanced spline operations, including differentiation, integration, break/knot manipulation, and optimal knot placement

  • support for piecewise polynomial form (ppform) and basis form (b-form) splines

  • support for tensor-product splines and rational splines (including nurbs)

in curve fitting toolbox you can fit splines interactively or programmatically.

interactive spline fitting

use the curve fitter app or the spline tool to interactively create spline fits.

open the curve fitter app by entering curvefitter at the matlab command line. alternatively, on the apps tab, in the math, statistics and optimization group, click curve fitter. the curve fitter app supports the same spline fitting options as the fit function.

open the spline tool by entering splinetool at the command line. the spline tool supports all spline functions. use the tool to do the following:

  • vary spline parameters and tolerances.

  • view and modify data, breaks, knots, and weights.

  • view the error of the spline, or the spline's first or second derivative.

  • observe the toolbox commands that generated your spline.

  • create and import data, including built-in instructive data sets, and save splines to the workspace.

for more information, see .

programmatic spline fitting

use the fit function to do the following:

  • fit cubic spline interpolants to curves or surfaces.

  • fit smoothing splines and shape-preserving cubic spline interpolants only to curves.

  • fit thin-plate splines only to surfaces.

curve fitting toolbox also provides specific splines functions that allow more control and flexibility when you fit splines. for example, use the function, instead of fit with fittype set to "cubicinterp", if you want to do one of the following:

  • combine the results with other splines, for example, by addition.

  • create vector-valued splines. you can use with scalars, vectors, matrices, and nd-arrays. the fit function supports only scalar-valued splines.

  • create other types of splines such as ppform, b-form, tensor-product, rational, and stform thin-plate splines.

  • create splines without data.

  • specify breaks, optimize knot placement, and use specialized functions for spline manipulation such as differentiation and integration.

for more information on how to create splines including b-form, tensor-product, nurbs, and other rational splines, see .

see also

apps

functions

网站地图