Main Content

曲线拟合

Fit curves and surfaces to data

Description

The曲线拟合app provides a flexible interface where you can interactively fit curves and surfaces to data and view plots.

You can:

  • Create, plot, and compare multiple fits.

  • Use linear or nonlinear regression, interpolation, smoothing, and custom equations.

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

  • Automatically generate code to fit and plot curves and surfaces, or export fits to the workspace for further analysis.

Open the Curve Fitting App

  • MATLAB®Toolstrip: On theAppstab, underMath, Statistics and Optimization, click the app icon.

  • MATLAB command prompt: Entercftool.

Programmatic Use

expand all

cftoolopens Curve Fitting app or brings focus to the app if it is already open.

cftool( x, y )creates a curve fit toxinput andyoutput.xandymust be numeric, have two or more elements, and have the same number of elements.cftoolopens Curve Fitting app if necessary.

cftool( x, y, z )creates a surface fit toxandyinputs andzoutput.x,y, andzmust be numeric, have two or more elements, and have compatible sizes. Sizes are compatible ifx,y, andzall have the same number of elements orxandyare vectors,zis a 2D matrix,length(x ) = n, andlength(y) = mwhere[m,n] = size(z).cftoolopens Curve Fitting app if necessary.

cftool( x, y, [], w )creates a curve fit with weightsw.wmust be numeric and have the same number of elements asxandy.

cftool( x, y, z, w )creates a surface fit with weightsw.wmust be numeric and have the same number of elements asz.

cftool( filename )loads the Curve Fitting session infilenameinto Curve Fitting app. Thefilenamemust have the extension.sfit.

See Also

Functions

Introduced before R2006a