MathGroup Archive 2006

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

Search the Archive

Re: product formula in mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68782] Re: product formula in mathematica
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 18 Aug 2006 03:12:39 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <ec19d4$oie$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

frou wrote:
> Hi I am interested in doing a product over a set of indices that are
> not continuous
> Product [ f(x_i) , { x_i, 1,3,4,9}]     Is this possible it appears
> that the iterator wouldonly take sequences such as 1...10 etc.

Times @@ MapThread[f[Subscript[x, #1]] & , {{1, 3, 4, 9}}]

--> f[Subscript[x, 1]]*f[Subscript[x, 3]]*f[Subscript[x, 
4]]*f[Subscript[x, 9]]

Times @@ MapThread[f[x[#1]] & , {{1, 3, 4, 9}}]

--> f[x[1]]*f[x[3]]*f[x[4]]*f[x[9]]

http://documents.wolfram.com/mathematica/functions/Apply
http://documents.wolfram.com/mathematica/functions/MapThread

HTH,
Jean-Marc


  • Prev by Date: Re: calculate Recurrence Equations
  • Next by Date: NonlinearFit + Sums
  • Previous by thread: RE: product formula in mathematica
  • Next by thread: question?