Re: building a list containing elements f(i,j)
- To: mathgroup at smc.vnet.net
- Subject: [mg71109] Re: [mg71045] building a list containing elements f(i,j)
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Wed, 8 Nov 2006 06:16:20 -0500 (EST)
- Reply-to: hanlonr at cox.net
Table[f[i,j],{i,0,2},{j,0,3}]//Flatten
{f(0,0),f(0,1),f(0,2),f(0,3),f(1,0),f(1,1),f(1,2),f(1,3),f(2,0),f(2,1),f(2,
2),f(2,3)}
Array[f,{3,4},{0,0}]//Flatten
{f(0,0),f(0,1),f(0,2),f(0,3),f(1,0),f(1,1),f(1,2),f(1,3),f(2,0),f(2,1),f(2,
2),f(2,3)}
{Array[f,{3,4},{0,0},Sequence]}
{f(0,0),f(0,1),f(0,2),f(0,3),f(1,0),f(1,1),f(1,2),f(1,3),f(2,0),f(2,1),f(2,
2),f(2,3)}
%==%%==%%%
True
Bob Hanlon
---- "xarnaudx at gmail.com" <xarnaudx at gmail.com> wrote:
>
> hi,
> i want to construct a list of the form:
> { f[1,1], ... f[n,m] }
> So the list contains elements of the form f[i,j] with i ranging from 0
> to n, and j from 0 to somebound[i].
>
> What would be the most elegant way to this?
> thanks
>
--
Bob Hanlon
hanlonr at cox.net