       RE: Function interpolation

• To: mathgroup at smc.vnet.net
• Subject: [mg45368] RE: [mg45336] Function interpolation
• From: "tgarza01 at prodigy.net.mx" <tgarza01 at prodigy.net.mx>
• Date: Sat, 3 Jan 2004 01:35:10 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```First, you are using the name Table which is a Mathematica in-built
function for a list of numbers defined by you. Use any other (non-reserved)
name. Second, you have to respect the syntax of parentheses and brackets.
Then,

In:=
otherName = {{0, 0}, {1, 2}, {2, 4}, {3, 8}, {4, 16},
{5, 32}};

In:=
newfunction = Interpolation[otherName]
Out=
InterpolatingFunction[]

In:=
newfunction[2.3]
Out=
4.899

In:=
Plot[{newfunction[x], Derivative[newfunction][x]},
{x, 0, 5}]

Tomas Garza
Mexico City

Original Message:
-----------------
From:  fernandoronci at hotmail.com (Fernando Ronci)
To: mathgroup at smc.vnet.net
Subject: [mg45368] [mg45336] Function interpolation

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

--------------------------------------------------------------------
mail2web - Check your email from the web at
http://mail2web.com/ .

```

• Prev by Date: RE: Windows ME fonts
• Next by Date: RE: why Pi is not recognized as a positive number?
• Previous by thread: Re: Function interpolation
• Next by thread: Re: Function interpolation