Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Fit data with range

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88435] Re: Fit data with range
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Mon, 5 May 2008 06:14:16 -0400 (EDT)
  • Organization: University of Bergen
  • References: <fvhdv7$3q6$1@smc.vnet.net>

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