Fit curves and surfaces to data using regression, interpolation, and smoothing using Curve Fitting Toolbox™.
Curve Fitting Toolbox provides interactive tools and command line functions for fitting curves and surfaces to data. The toolbox lets you interactively explore relationships between data, generate predictive models, and conveniently use or share your curve fit. Post-processing analysis options include prediction and forecasting, calculating integrals and derivatives, and estimating confidence intervals.
Interactive tools let you load data from the MATLAB workspace, choose between regression, interpolation, or smoothing algorithms, generate a fit and evaluate the quality of the resulting fits using metrics like r squared and validation error. You can apply more sophisticated analysis techniques. For example, apply multiple fitting algorithms to the same dataset, use a residual plot to evaluate the quality of a fit, or exclude outliers from your dataset.
It's easy to repeat an analysis with a new dataset. You can perfect your analytic techniques using the interactive fitting tool. Use the generate code option to create a function just like this one and then use this function to replicate the same analysis on a new dataset or batch process large numbers of datasets. Alternatively, you can generate a fit using the interactive tools, export this model to the MATLAB workspace, and then use the model for post-processing analysis. For example, you can generate a surface plot of your model with a single command, use the model for forecasting, or calculate an integral or derivative.
There are lots of additional resources to help you learn more about Curve Fitting Toolbox. You can view webinars and look at sample code or inspect a complete list of toolbox functions. For more information, return to the product page or choose a link below.
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.