Re: Using output of a Fit
- To: mathgroup at smc.vnet.net
- Subject: [mg24909] Re: [mg24895] Using output of a Fit
- From: BobHanlon at aol.com
- Date: Sun, 20 Aug 2000 01:34:57 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 8/19/2000 4:58:26 AM, owenzooey at my-deja.com writes: >I've used > >Fit[data,{1,x},x] > >to determine a best-fit line. > >How can I automatically send the output of Fit to be evaluated using >different values of x? > Use Fit in the definition of a function then use the function as you would any other function. data = Table[7*x + 3 + 10*Random[], {x, 10}]; f[x_] := Evaluate[Fit[data, {1, x}, x]] Needs["Graphics`Graphics`"] DisplayTogether[ ListPlot[data, PlotStyle -> {AbsolutePointSize[3], RGBColor[1, 0, 0]}], Plot[f[x], {x, 0, 10}, PlotStyle -> RGBColor[0, 0, 1]]]; Bob Hanlon