Curve Fitting Toolbox
Curve Fitting Toolbox provides the most widely used techniques for fitting curves and surfaces to data, including linear and nonlinear regression, splines and interpolation, and smoothing. The toolbox supports options for robust regression to fit data sets that contain outliers. All algorithms can be accessed through functions or the Curve Fitting app.
The Curve Fitting app simplifies common tasks that include:
Working at the command line lets you develop custom functions for analysis and visualization. These functions enable you to:
Curve Fitting Toolbox provides a simple intuitive syntax for command-line fitting, as in the following examples:
fittedmodel = fit([X,Y], Z, 'poly11');
fittedmodel = fit(X, Y, 'fourier2');
fittedmodel = fit([Time,Temperature], Energy, 'cubicinterp');
fittedmodel = fit([Time,Temperature], Energy, 'lowess', ‘span’, 0.12);
The results of a fitting operation are stored in an object called
“fittedmodel.” Postprocessing analysis, such as plotting, evaluation, and calculating integrals and derivatives, can be performed by applying a method to this object, as in these examples:
differentiate(fittedmodel, X, Y)
Curve Fitting Toolbox lets you move interactive fitting to the command line. Using the app, you can automatically generate MATLAB code. You can also create fit objects with the app and export them to the MATLAB workspace for further analysis.