Main Content

cfit

Constructor forcfitobject

Description

example

cfun= cfit(ffun,coeff1,...,coeffn)constructs thecfitobjectcfunusing the model type specified by thefittypeobjectffunand the coefficient valuescoeff1,coeff2, etc.

Note

cfitis called by thefitfunction when fittingfittypeobjects to data. To create acfitobject that is the result of a regression, usefit.

You should only callcfitdirectly if you want to assign values to coefficients and problem parameters of afittypeobjectwithoutperforming a fit.

Examples

collapse all

创建一个fittypeobject and call thecfitfunction.

f = fittype('a*x^2+b*exp(n*x)') c = cfit(f,1,10.3,-1e2)
f = General model: f(a,b,n,x) = a*x^2+b*exp(n*x) c = General model: c(x) = a*x^2+b*exp(n*x) Coefficients: a = 1 b = 10.3 n = -100

Input Arguments

collapse all

Model type thecfitfunction uses to construct thecfitobject, specified as afittypeconstructed with thefittypefunction.

Example:fittype('poly2')

Coefficient values of thecfitobject, specified as scalars.

Data Types:single|double

Output Arguments

collapse all

Function output, returned as acfitobject.

Introduced before R2006a