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

MathGroup Archive 2007

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

Search the Archive

V6 evaluation inside Table and plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg76577] V6 evaluation inside Table and plot
  • From: Gerry Flanagan <flanagan at materials-sciences.com>
  • Date: Thu, 24 May 2007 06:04:47 -0400 (EDT)

Define a simple function

In[7]:= f = Function[{x}, x^3]

Out[7]= Function[{x}, x^3]

Taking two derivatives works as it should

In[2]:= f''[x]

I was converting some packages to work with V6, and immediately ran into 
some evaluation issues I don't understand. It looks like forms like 
f''[x] (derivative) are evaluated differently inside of Table and Plot 
than outside.

Out[2]= 6 x

But this does not?

In[20]:= Table[f''[x], {x, 0, 1, .2}]

Out[20]= {0, 0, 0, 0, 0, 0}

Strangely, this works

In[4]:= Table[f'[x], {x, 0, 1, .2}]

Out[4]= {0., 0.12, 0.48, 1.08, 1.92, 3.}

Determining the derivative outside the Table makes it work again.

In[12]:= g = f'';

In[21]:= tmp = Table[g[x], {x, 0, 1, .2}]

Out[21]= {0., 1.2, 2.4, 3.6, 4.8, 6.}

Gerry Flanagan


  • Prev by Date: Re: Problem with Animate in Mathematica 6.0
  • Next by Date: Re: Weird result in Mathematica 6
  • Previous by thread: Re: exporting graphics
  • Next by thread: Re: V6 evaluation inside Table and plot