Re: Particular structure
- To: mathgroup at smc.vnet.net
- Subject: [mg33567] Re: Particular structure
- From: bghiggins at ucdavis.edu (Brian Higgins)
- Date: Sun, 31 Mar 2002 04:09:26 -0500 (EST)
- References: <a81jgj$778$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Yas, Will this work for you?
f[x_, y_, z_] := x + y + z
Map[Map[f[#, z] &, {x1, x2, x3}] /. (f[x_, z_] -> f[x, #, z]) &, {y1,
y2, y3}]
{{x1 + y1 + z, x2 + y1 + z, x3 + y1 + z}, {x1 + y2 + z, x2 + y2 + z,
x3 + y2 + z}, {x1 + y3 + z, x2 + y3 + z, x3 + y3 + z}}
Cheers,
Brian
Yas <yast at optushome.com.au> wrote in message news:<a81jgj$778$1 at smc.vnet.net>...
> G'day,
> 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.
>
> Thanks
> Yas