Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: Creating a new table using values from a column in another table,

  • To: mathgroup at smc.vnet.net
  • Subject: [mg66370] Re: Creating a new table using values from a column in another table,
  • From: bghiggins at ucdavis.edu
  • Date: Thu, 11 May 2006 02:14:23 -0400 (EDT)
  • References: <e3sgqp$lsf$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Michael, Try this.

First some data:

data=Table[{i,2 i+3+Random[]},{i,0.5,3,0.5}]

{{0.5,4.01533},{1.,5.95668},{1.5,6.34622},{2.,7.95788},{
  2.5,8.4528},{3.,9.2798}}

Now lets fit the dat to a function

f[x_]=Fit[data,{1,x},x]

3.45921+2.02414 x

Then we use a rule to get the new table

newdata=data/.{x_,y_}\[Rule]{x,f[x]}

{{0.5,4.47128},{1.,5.48335},{1.5,6.49542},{2.,7.50748},{
  2.5,8.51955},{3.,9.53162}}

Hope this helps,
Cheers,
Brian


  • Prev by Date: Re: Re: svg import
  • Next by Date: Re: Question on Map or Apply
  • Previous by thread: Re: Creating a new table using values from a column in another table,
  • Next by thread: Re: Creating a new table using values from a column in another table,