Re: Fit
- To: mathgroup at smc.vnet.net
- Subject: [mg7050] Re: [mg7011] Fit
- From: seanross at worldnet.att.net
- Date: Sat, 3 May 1997 22:04:43 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
WANNKE Michael wrote:
>
> Hi!
>
> I would like to fit a database. The function Fit works quite well, but
> if I use the following command line:
> fitted = Fit[database,{1,x,x^2},x]
> Mathematica returns a fixed expression with x as variable. The problem
> is that now x is the only variable which can be used:
> Plot[fitted,{x,0,1000}] returns the right graph
> Plot[fitted, {z,0,1000}] returns an error!
>
> How can I fit my database in order to get a function (style f[x]:=...)?
>
> Thank you very much.
>
> Michael Wannke
> wannkem8 at cti.ecp.fr
Use something like:
f[a_]=Evaluate[Fit[database,{1,x,x^2},x]]/.x->a;