MathGroup Archive 2008

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

Search the Archive

Re: Mathematica Help Urgent (Very New Beginner)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93379] Re: [mg93332] Mathematica Help Urgent (Very New Beginner)
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Wed, 5 Nov 2008 04:55:46 -0500 (EST)
  • Organization: Mathematics & Statistics, Univ. of Mass./Amherst
  • References: <200811041117.GAA29117@smc.vnet.net>
  • Reply-to: murray at math.umass.edu

With Mathematica version 6, you may now use the form

   Table[expr, {i, {i1, i2,...,ik}}]

in order to specify a particular list of values for the iterator i 
instead of a regularly incremented list.

For example:

   f[x_] := x^(-3) Cos[2 x]
   f1[x_] = f'[x]; f2[x_] = f''[x];

   info=Table[N@{x, f[x], f1[x], f2[x]}, {x, {-3, 1, 1/2, Pi, -5}}];
   headers = TraditionalForm /@
     {HoldForm[x],HoldForm[f[x]],HoldForm[f'[x]],HoldForm[f''[x]]};
   TableForm[info,TableHeadings->{None,headers}]


Derek wrote:
> I am just beginning to learn to use Mathematica, and need to create a table of values. I would like to be able to input x-values and have the table display f(x), f'(x), and possibly f''(x) for a given function. I have already specified the function, and I have found the following input creates tables:
> 
> Table[{x,f[x]},{x,-5,5,.5}]
> 
> My problem is this: I would like to input specifc x-values, rather than use set intervals as defined in {x,-5,5,.5} above. Is there a way to specify a list of specific x values so that Mathematica computes the values of f[x] in table form?
> 
> Any help would be greatly, greatly appreciated. Thanks.
> 

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: From reactions to differential equations
  • Next by Date: Re: Create a cumulative list
  • Previous by thread: RE: Mathematica Help Urgent (Very New Beginner)
  • Next by thread: Re: Mathematica Help Urgent (Very New Beginner)