## Documentation |

In the Curve Fitting app, you can exclude data from curve and surface fits by applying rules, for example, x > 0. For details, see Exclude Data Ranges.

In previous releases, you could only apply exclusion rules at the command line or by using the legacy Curve Fitting Tool.

You can fit thin-plate spline surfaces in the Curve Fitting
app and with the `fit` function. Use thin-plate
splines when you require both smooth surface interpolation and good
extrapolation properties.

In previous releases, you could use the `tpaps` function
to fit thin-plate splines. However, the `tpaps` function
has a different syntax from the `fit` function and
requires manual preprocessing of data.

For details, see Interpolants.

In the Curve Fitting app, you can define custom linear equations that use linear least-squares fitting. Linear least-squares fitting is more efficient and usually faster than nonlinear fitting.

In previous releases, you could define linear equations in the Custom Equation fit type, but the toolbox used nonlinear fitting that was slower. To use linear least-squares fitting of custom linear equations, you had to use the legacy Curve Fitting Tool. You no longer need to use the legacy tool because you can use the Linear Fitting model type in the Curve Fitting app.

For details, see Custom Linear Fitting.

Function Element Name | What Happens When You Use This Function Element | Use This Instead | Compatibility Considerations |
---|---|---|---|

'Algorithm', 'Gauss-Newton' name/value pair
argument as input to fitoptions method | Errors | 'Algorithm', 'Levenberg-Marquardt' name/value pair argument as input to fitoptions method | Use 'Levenberg- as
the value for Marquardt' Algorithm instead. |

New warning that the legacy Curve Fitting Tool will be removed in a future release.

Function | What Happens When You Use This Input | Use This Instead | Compatibility Considerations |
---|---|---|---|

cftool -v1 | Opens the legacy Curve Fitting Tool and warns. | cftool | The legacy Curve Fitting Tool will be removed in a future release.
Use cftool instead. |

You can now use the **Print to Figure** option
in Curve Fitting Tool to produce MATLAB^{®} figures from the results
of curve fitting. You can then use the interactive plotting tools
to edit the figures with fitting results for presentation purposes
and export them in different formats.

In previous releases, to produce figures from your fits, you had to generate MATLAB code from your Curve Fitting Tool session. To recreate all your fits and plots, you then had to save and call the file from the command line using your original data or new data as input arguments.

All plots in the Curve Fitting Tool have new colormaps and markers to enhance visibility of points and the fit. Plots with hundreds of points are much clearer because markers no longer have white surrounds. The new plots fix problems in previous versions when plotting thousands of points could make it impossible to see the fit.

On surface plots with the new colormap, red has switched from high to low values. Compare contour plots with the main surface plot to check high and low areas.

Function Name | What Happens When You Use This Function | Use This Instead | Compatibility Considerations |
---|---|---|---|

cflibhelp | Warns that the cflibhelp function has been
replaced by documentation. | List of Library Models for Curve and Surface Fitting in the documentation. | Use the documentation instead of cflibhelp. |

With the unified interactive Curve Fitting Tool, you can now fit curves and surfaces in the same GUI. The new Curve Fitting Tool has improved usability so you can choose data, fit types and plot settings within one window, without needing to open any separate dialogs. You can generate MATLAB code to recreate all your fits and plots. You can now zoom and pan on surface plots.

For information and examples, see Interactive Curve and Surface Fitting .

Function Element Name | What Happens When You Use This Function Element | Use This Instead | Compatibility Considerations |
---|---|---|---|

sftool | Opens new Curve Fitting Tool, and warns that sftool function
will be removed in a future release. | cftool | Use cftool instead. |

cftool | Opens new Curve Fitting Tool. | N/A | Change in behavior to open new Curve Fitting Tool. |

Curve Fitting Tool in R2011b has some changes in behavior to previous releases of Curve Fitting Tool:

No exclusion rules. You can exclude data graphically, but you cannot save exclusion rules.

No analysis GUI. You can use command-line functions to achieve the same goals. See Analyzing Your Best Fit in the Workspace.

No custom linear equations. You can define a custom linear equation, but the custom equation fit uses nonlinear fitting which is usually slower than linear least-squares fitting. If you need linear least-squares fitting for custom equations, you must use the legacy Curve Fitting Tool. See Custom Linear Models.

Cannot load old sessions in the new tool. If you need to use old sessions, see the

`cftool`help to access legacy Curve Fitting Tool.

The `fit` and `fittype` functions
now accept anonymous functions. This enables you to use anonymous
functions to define equations for curve fitting. Previously, `fittype` only
accepted a text string or a cell array of text strings. Now you can
also use anonymous functions, making it easier to pass other data
into the function.

Curve Fitting Toolbox™ now contains all of the spline functions that were previously available in Spline Toolbox™.

Splines are smooth piecewise polynomials. You can use the spline
functions to create and manipulate spline approximation models of
data. You can create splines in piecewise polynomial form (`ppform`)
and B-form.

The spline functions are a collection of algorithms for data fitting, interpolation, extrapolation, and visualization. The new spline features include a graphical user interface for creating, visualizing, and manipulating splines. Additional functions enable you to evaluate, plot, combine, differentiate, and integrate splines, manipulate breaks/knots, and optimally place knots.

For more information see Spline Fitting in the Curve Fitting Toolbox User's Guide.

In Surface Fitting Tool, you can select matrices of the same
size, or you can also now fit surfaces to data stored as a table.
"Table data" means that `X` and `Y` represent
the row and column headers of a table and the values in the table
are the values of the `Z` output. Sizes are compatible
if `X` and `Y` are vectors of length `n` and `m`,
and `Z` is a matrix of size `[m,n]`.
For more details see Table
Data in the Interactive Surface Fitting documentation.

Surface Fitting Tool can now read integer and floating-point
data. You can now select any numeric data in your workspace. Previously
the tool would only accept vectors of type `double`.

For more information see Interactive Data Selection in the Interactive Surface Fitting documentation.

A new toolbar in Surface Fitting Tool makes it easier to discover and control plotting options. You can use the toolbar to:

Toggle plot mode between Rotate 3D, Data Cursor, and Exclude Outliers

Control which plots are displayed of Surface, Residuals and Contour plots

Control the Legend, Grid and Axis Limits

See Exploring and Customizing Plots in the Surface Fitting Tool documentation.

In Surface Fitting Tool, plot mode now defaults to Rotate 3D. A common surface fitting workflow is to manipulate and view the surface plot from various angles. You no longer have to select plot rotate mode initially, because it is now on by default. You can use the toolbar to switch to data cursor or exclude outliers mode. When you turn off data cursor or exclude outliers mode, your cursor mode is automatically set back to Rotate.

See Using Zoom, Pan, Data Cursor, and Outlier Exclusion in the Surface Fitting Tool documentation.

The initial surface fit for polynomials is now a linear plane
in **x** and **y** (`poly11`).
Previously the default fit was a quadratic polynomial in **x** and **y** (`poly22`).

If you are going to use a polynomial to fit a model, it can be helpful to start by looking at a reference plane.

The `gaussian` library model has been updated
to use improved starting value defaults. You may see different answers
to previous releases because of the improved starting values.

Function Element Name | What Happens When You Use This Function Element | Use This Instead | Compatibility Considerations |
---|---|---|---|

'Algorithm', 'Gauss-Newton' property name/value
pair as input to fitoptions method | Warns when you call the fit method | 'Algorithm', 'Levenberg-Marquardt' property name/value pair as input to fitoptions method | Use 'Levenberg-as
the value for Algorithm instead.Marquardt' |

New features introduced in this version:

New function to compute the first and second derivatives of a fitted surface. See differentiate.

New function to compute the volume under a fitted surface. See quad2d.

You can interactively fit surfaces to data and view plots with the new flexible and intuitive Surface Fitting Tool GUI.

Create, plot, and compare multiple surface fits

Use linear or nonlinear regression, interpolation, local smoothing regression, or custom equations

View goodness-of-fit statistics, display confidence intervals and residuals, remove outliers and assess fits with validation data

Automatically generate M-code for fitting and plotting surfaces, or export fits to workspace for further analysis

For more information, see Example: Interactive Surface Fitting.

New surface fit objects store the results from a fitting operation, making it easy to plot and analyze fits at the command line.

For more information, see Custom Nonlinear Surface Fitting Examples.

Release | Features or Changes with Compatibility Considerations |
---|---|

R2014b | None |

R2014a | None |

R2013b | Functions and Function Elements Being Removed |

R2013a | Function with Compatibility Changes |

R2012b | None |

R2012a | |

R2011b | |

R2011a | None |

R2010b | None |

R2010a | Functions and Function Elements Being Removed |

R2009b | None |

R2009a | None |

R2008b | None |

R2008a | None |

R2007b | None |

R2007a | None |

R2006b | None |

R2006a | None |

R14SP3 | None |

R14SP2 | None |

Was this topic helpful?

© 1994-2014 The MathWorks, Inc.

© 1994-2014 The MathWorks, Inc.