MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Fit data with range

Ivan wrote:
> Hi
> I want to fit a polynomial function to a set of data,
> only between say xmin to xmax. How can I do that?
> I know only how to fit the whole range.
> For example:
> data = ReadList["file.dat",{Number,Number}];
> fit = Fit[data,{1,x,x^2},x]
> Plot[fit,{x,0,10}]

Filter the data with Select or Case!  The exact command to use depends 
on the shape of the data.  E.g. Case[data, {x_, _} /; xmin <= x <= xmax]

  • Prev by Date: Re: locator snap
  • Next by Date: Re: Identical elements
  • Previous by thread: Re: Fit data with range
  • Next by thread: Re: Fit data with range