Main Content



绘图、离群值、残差、置信区间、验证数据、积分和导数,生成 MATLAB® 代码


您可以使用 Curve Fitting Toolbox™ 函数通过绘制残差和预测边界来评估拟合情况。有关详细信息,请参阅Evaluate Curve Fit。要比较拟合情况并以交互方式生成 MATLAB 代码,请使用曲线拟合器




cfitcfit 对象的构造函数
coeffnamescfitsfitfittype 对象的系数名称
coeffvaluescfitsfit 对象的系数值
confintConfidence intervals for fit coefficients of cfit or sfit object
differentiateDifferentiate cfit or sfit object
fevalEvaluate cfit, sfit, or fittype object
integrateIntegrate cfit object
plotPlot cfit or sfit object
predintPrediction intervals for cfit or sfit object
probvaluesProblem-dependent parameter values of cfit or sfit object
quad2dNumerically integrate sfit object
sfitConstructor for sfit object


  • Create Multiple Fits in Curve Fitter App

    Workflow for refining your fit, comparing multiple fits, and using statistics to determine the best fit.

  • Explore and Customize Plots

    In the Curve Fitter app, display fit, residual, surface, or contour plots; display prediction bounds and multiple plots, use zoom, pan, data cursor, and outliers modes; change axes limits and print plots.

  • Export Fit from Curve Fitter App to Simulink Lookup Table

    Export a surface fit from the Curve Fitter app to a Simulink® 2-D lookup table.

  • Remove Outliers

    Remove points interactively or exclude them by rule in the Curve Fitter app. Alternatively, exclude outliers by using the fit function. You can exclude data based on their distance from the model, in standard deviations.

  • Select Validation Data

    Compare your fit with validation data or test set in the Curve Fitter app.

  • Generate Code and Export Fits to the Workspace

    Generate MATLAB code from an interactive session in the Curve Fitter app, recreate fits and plots, and analyze fits in the workspace.

  • Evaluate Curve Fit

    This example shows how to work with a curve fit.

  • Evaluate Surface Fit

    This example shows how to work with a surface fit.

  • Evaluating Goodness of Fit

    After fitting data with one or more models, evaluate the goodness of fit using plots, statistics, residuals, and confidence and prediction bounds.

  • Compare Fits in Curve Fitter App

    Find the best fit by comparing visual and numeric results, including fitted coefficients and goodness-of-fit statistics.

  • Compare Fits Programmatically

    This example shows how to fit and compare polynomials up to sixth degree using Curve Fitting Toolbox™, fitting some census data.

  • Residual Analysis

    The residuals from a fitted model are defined as the differences between the response data and the fit to the response data at each predictor value.

  • Confidence and Prediction Bounds

    Curve Fitting Toolbox software lets you calculate confidence bounds for the fitted coefficients, and prediction bounds for new observations or for the fitted function.

  • Differentiating and Integrating a Fit

    This example shows how to find the first and second derivatives of a fit, and the integral of the fit, at the predictor values.