This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Constructor for cfit object


cfun = cfit(ffun,coeff1,coeff2,...)


cfun = cfit(ffun,coeff1,coeff2,...) constructs the cfit object cfun using the model type specified by the fittype object ffun and the coefficient values coeff1, coeff2, etc.

    Note:   cfit is called by the fit function when fitting fittype objects to data. To create a cfit object that is the result of a regression, use fit.

    You should only call cfit directly if you want to assign values to coefficients and problem parameters of a fittype object without performing a fit.


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

Introduced before R2006a

Was this topic helpful?