Re: generating all combinations.
- To: mathgroup at smc.vnet.net
- Subject: [mg22424] Re: generating all combinations.
- From: "DIAMOND Mark" <noname at noname.com>
- Date: Wed, 1 Mar 2000 00:40:24 -0500 (EST)
- Organization: The University of Western Australia
- References: <89cea2$bsp@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
I think this does the trick even though it doesn't look very elegant. There is probably a far (!) neater way. f[{low_, high_}, depth_] := Flatten[Outer[List, Apply[Sequence, Table[Range[low, high], {depth}]]], depth - 1] low and high are the limits of the range that you want. depth is the number of different subscripts you would have had. So that in my code, your example would be f[{-2,2},3] Cheers, -- Mark R Diamond Vision Research Laboratory The University of Western Australia no spam email: markd at psy dot uwa dot edu dot au >