Skip to Main Content Skip to Search
Accelerating the pace of engineering and science

 

Curve Fitting Toolbox

Product Description

Working with 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 the command line or by using GUIs.

 Introduction to Surface Fitting 7:20
Use the Surface Fitting Tool GUI to fit curves and surfaces to data using regression, interpolation, and smoothing.

Fitting multiple candidate models to a single data series using the Surface Fitting Tool.

Fitting multiple candidate models to a single data series using the Surface Fitting Tool. You can compare the fitted surfaces visually or use goodness-of-fit metrics such as R2, adjusted R2, sum of the squared errors, and root mean squared error.

Fitting Data with GUIs

The Curve Fitting Tool GUI and Surface Fitting Tool GUI simplify common tasks that include:

  • Importing data from the MATLAB® workspace
  • Visualizing your data to perform exploratory data analysis
  • Generating fits using multiple fitting algorithms
  • Evaluating the accuracy of your models
  • Performing postprocessing analysis that includes interpolation and extrapolation, generating confidence intervals, and calculating integrals and derivatives
  • Exporting fits to the MATLAB workspace for further analysis
  • Automatically generating MATLAB code to capture work and automate tasks
MATLAB function generated with the Surface Fitting Tool.

MATLAB function generated with the Surface Fitting Tool.

Working at the Command Line

Working at the command line lets you develop custom functions for analysis and visualization. These functions enable you to:

  • Duplicate your analysis with a new data set
  • Replicate your analysis with multiple data sets (batch processing)
  • Embed a fitting routine into MATLAB functions
  • Extend the base capabilities of the toolbox

Curve Fitting Toolbox provides a simple intuitive syntax for command-line fitting, as in the following examples:

  • Linear Regression: fittedmodel = fit([X,Y], Z, 'poly11');
  • Nonlinear Regression: fittedmodel = fit(X, Y, 'fourier2');
  • Interpolation: fittedmodel = fit([Time,Temperature], Energy, 'cubicinterp');
  • Smoothing: 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:

  • Plotting: plot(fittedmodel)
  • Differentiation: differentiate(fittedmodel, X, Y)
  • Evaluation: fittedmodel(80, 40)

Curve Fitting Toolbox lets you move from GUIs to the command line. Using the GUIs, you can generate MATLAB functions that duplicate any GUI-based analysis. You can also create fit objects within the GUI and export them to the MATLAB workspace for further analysis.

Extending the capabilities of the toolbox with a custom visualization.

Extending the capabilities of the toolbox with a custom visualization. The color of the heat map corresponds to the deviation between the fitted surface and a reference model.

Free Curve Fitting and Statistics Interactive Kit

Learn how to explore, analyze, model, and visualize your data quickly and efficiently.

Get free kit

Trials Available

Try the latest versions of MathWorks curve fitting products.

Get trial software
Contact sales
Free technical kit
Trial software

Get Pricing and
Licensing Options

Upcoming Webinar

Data Driven Fitting with MATLAB new

Free Seminar

Energy Trading and Risk Management with MATLAB new