MathGroup Archive 2004

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

Search the Archive

Re: Function interpolation


Lists are bounded by {}, not [], and Table is a protected symbol.

table = {{0, 0}, {1, 2}, {2, 4}, {3, 8}, {4, 16}, {5, 32}}
newfunction = Interpolation[%]
newfunction[2.3]

Bobby

fernandoronci at hotmail.com (Fernando Ronci) wrote in message news:<bt0uc8$hec$1 at smc.vnet.net>...
> Hi,
> 
> I'm new to Mathematica and need some hints on how to derive (or
> estimate) a function from a given set of discrete x/y values.
> I know Mathematica can do this but I don't know how.
> For example, I tried to create a table of x/y values, then assign the
> approximated funcion to 'newfunction' and test it by calling it with
> 2.3 as argument, but it failed as follows (I couldn't even figure out
> how to build the table):
> 
> Table = [{0, 0}, {1, 2}, {2, 4}, {3, 8}, {4, 16}, {5, 32}]
> newfunction = Interpolation[%]
> newfunction[2.3]
> 
> Syntax::"sntxf": "Table =" cannot be followed by "[{0, 0}, {1, 2}, {2,
> 4}, {3, 8}, {4, 16}, {5, 32}]".
> Table = [{0, 0}, {1, 2}, {2, 4}, {3, 8}, {4, 16}, {5, 32}]
> 
> BTW, I'm working with Mathematica 4.
> Help appreciated.
> Thank you,
> 
> Fernando Ronci
> E-mail: fernandoronci at hotmail.com


  • Prev by Date: Re: RunThrough on Windows 2000
  • Next by Date: Re: Printing "Alias" Definitions
  • Previous by thread: Re: Function interpolation
  • Next by thread: Re: Function interpolation