Main Content

sfit

sfit 对象的构造函数

说明

示例

surfacefit = sfit(fittype,coeff1,...,coeffn) 使用 fittype 对象指定的模型类型和系数值 coeff1coeff2 等构造 sfit 对象 surfacefit

sfit 对象封装对数据进行曲面拟合的结果。它们通常通过调用 fit 函数来构造,或通过将拟合从曲线拟合器导出到工作区以交互方式构造。您可以获取和设置 sfit 对象的系数属性。

您可以将 sfit 对象视为函数来进行预测或计算在 X 和 y 值处的曲面。

cfit 类一样,sfit 继承所有 fittype 方法。

注意

sfitfit 函数在对数据进行 fittype 对象拟合时调用。要创建作为回归结果的 sfit 对象,请使用 fit

如果您要为 fittype 对象的系数和问题参数赋值,而执行拟合,则应只直接调用 sfit

Methods of sfit objects:

argnames Input argument names of cfit, sfit, or fittype object
categoryCategory of fit of cfit, sfit, or fittype object
coeffnamesCoefficient names of cfit, sfit, or fittype object
dependnamesDependent variable of cfit, sfit, or fittype object
formulaFormula of cfit, sfit, or fittype object
indepnamesIndependent variable of cfit, sfit, or fittype object
islinearDetermine if cfit, sfit, or fittype object is linear
numargsNumber of input arguments of cfit, sfit, or fittype object
numcoeffsNumber of coefficients of cfit, sfit, or fittype object
probnamesProblem-dependent parameter names of cfit, sfit, or fittype object
probvaluesProblem-dependent parameter values of cfit or sfit object
quad2dNumerically integrate sfit object
setoptions Set model fit options
sfitConstructor for sfit object
typeName of cfit, sfit, or fittype object

示例

全部折叠

您可以将 sfit 对象视为函数来进行预测或计算在 X 和 y 值处的曲面。

        x = 3 - 6 * rand( 49, 1 );
        y = 3 - 6 * rand( 49, 1 );
        z = peaks( x, y );
        sf = fit( [x, y], z, 'poly32' );
        zhat = sf( mean( x ), mean( y ) )

输入参数

全部折叠

sfit 函数用于构造 sfit 对象的模型类型,指定为用 fittype 函数构造的 fittype

示例: fittype('linearinterp')

sfit 对象的系数值,指定为标量。

数据类型: single | double

输出参量

全部折叠

函数输出,以 sfit 对象形式返回。

版本历史记录

在 R2009a 中推出