Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
how to pull variables from cfit object???

Subject: how to pull variables from cfit object???

From: Kit Neel

Date: 28 May, 2008 21:09:02

Message: 1 of 3

I have used fit and fittype to find best-fit parameters for
a custom non-linear model. The fitting procedures appears
to do a very good job. However, I need to be able to
reference the fitted parameters, and I can't seem to figure
out how to pull them out of the cfit object.

For example, this is the output of my fit command:

fit_to_mix_Hug_Meyers =

     General model:
       fit_to_mix_Hug_Meyers(x) = Co^2*(Vo-x) / (Vo-S*(Vo-
x))^2
     Coefficients (with 95% confidence bounds):
       Co = 4.633 (4.632, 4.634)
       S = 1.504 (1.501, 1.507)
     Problem parameters:
       Vo = 0.2782

How can I pull the values of Co and S? Right now I have to
enter them manually, which is tedious.

thanks,
Kit Neel

Subject: how to pull variables from cfit object???

From: Steven Lord

Date: 28 May, 2008 21:33:29

Message: 2 of 3


"Kit Neel" <kitUNDERSCOREneel@gatech.delete.this.part.edu> wrote in message
news:g1khle$2fl$1@fred.mathworks.com...
>I have used fit and fittype to find best-fit parameters for
> a custom non-linear model. The fitting procedures appears
> to do a very good job. However, I need to be able to
> reference the fitted parameters, and I can't seem to figure
> out how to pull them out of the cfit object.
>
> For example, this is the output of my fit command:
>
> fit_to_mix_Hug_Meyers =
>
> General model:
> fit_to_mix_Hug_Meyers(x) = Co^2*(Vo-x) / (Vo-S*(Vo-
> x))^2
> Coefficients (with 95% confidence bounds):
> Co = 4.633 (4.632, 4.634)
> S = 1.504 (1.501, 1.507)
> Problem parameters:
> Vo = 0.2782
>
> How can I pull the values of Co and S? Right now I have to
> enter them manually, which is tedious.

http://www.mathworks.com/access/helpdesk/help/toolbox/curvefit/coeffvalues.html

You'll probably also want to look at the functions listed in the "See Also"
section on that page.

--
Steve Lord
slord@mathworks.com

Subject: how to pull variables from cfit object???

From: Kit Neel

Date: 29 May, 2008 13:18:02

Message: 3 of 3

"Steven Lord" <slord@mathworks.com> wrote in message
<g1kj39$lcr$1@fred.mathworks.com>...
>
> "Kit Neel" <kitUNDERSCOREneel@gatech.delete.this.part.edu>
wrote in message
> news:g1khle$2fl$1@fred.mathworks.com...
> >I have used fit and fittype to find best-fit parameters for
> > a custom non-linear model. The fitting procedures appears
> > to do a very good job. However, I need to be able to
> > reference the fitted parameters, and I can't seem to figure
> > out how to pull them out of the cfit object.
> >
> > For example, this is the output of my fit command:
> >
> > fit_to_mix_Hug_Meyers =
> >
> > General model:
> > fit_to_mix_Hug_Meyers(x) = Co^2*(Vo-x) / (Vo-S*(Vo-
> > x))^2
> > Coefficients (with 95% confidence bounds):
> > Co = 4.633 (4.632, 4.634)
> > S = 1.504 (1.501, 1.507)
> > Problem parameters:
> > Vo = 0.2782
> >
> > How can I pull the values of Co and S? Right now I have to
> > enter them manually, which is tedious.
>
>
http://www.mathworks.com/access/helpdesk/help/toolbox/curvefit/coeffvalues.html
>
> You'll probably also want to look at the functions listed
in the "See Also"
> section on that page.
>
> --
> Steve Lord
> slord@mathworks.com
>
>

Thanks! Seems like that would be mentioned on the help page
for the fit command....

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us