MathGroup Archive 2002

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

Search the Archive

Re: Particular structure

  • To: mathgroup at
  • Subject: [mg33554] Re: [mg33545] Particular structure
  • From: BobHanlon at
  • Date: Sun, 31 Mar 2002 04:09:00 -0500 (EST)
  • Sender: owner-wri-mathgroup at

In a message dated 3/29/02 7:29:19 AM, yast at writes:

>How do I go about achieving the structured list below,
>{f[x1, y1, z], ... , f[xn, y1, z]}
>followed by some operation on the above list (e.g Fold), store the 
>result and then, do the same again for other y values, as in,
>{f[x1, ym, z], ... , f[xn, ym, z]}
>until the last value of ym.
>In summary, the n values of x get slotted in first for one value of y 
>then the resulting list is evaluated, the answer stored, values of x get
>slotted in again, y is incremented and so forth until all (m) values of
>y have been done.

x = {x1,x2,x3};
y = {y1,y2,y3,y4};

g /@ Outer[f[#2,#1,z]&, y, x]

{g[{f[x1, y1, z], f[x2, y1, z], f[x3, y1, z]}],
  g[{f[x1, y2, z], f[x2, y2, z], f[x3, y2, z]}],
  g[{f[x1, y3, z], f[x2, y3, z], f[x3, y3, z]}],
  g[{f[x1, y4, z], f[x2, y4, z], f[x3, y4, z]}]}

Bob Hanlon
Chantilly, VA  USA

  • Prev by Date: Re: [Q] Plotting Inequalities
  • Next by Date: Re: Problem
  • Previous by thread: Particular structure
  • Next by thread: Re: Particular structure