MathGroup Archive 2006

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

Search the Archive

Re: Tabling


JGBoone at gmail.com wrote:
> So I am having a problem running a Table[Table[,{}],{}]. It's just
> giving the findings of the first table and printing it however many
> times I tell the Second table. Any ideas how to get first table to
> rerun so i can get different vaules in the second table.

Could you please post an actual example of nested table expressions that 
does not yield what you expected? It difficult to help you more since 
the default behavior is that inner table expressions are always 
re-executed as you can see in the following examples:

In[1]:=
Table[Table[i + i, {j, 1, 3}], {i, 1, 5}]

Out[1]=
{{2,2,2},{4,4,4},{6,6,6},{8,8,8},{10,10,10}}

In[2]:=
Table[Table[Random[], {3}], {5}]

Out[2]=
{{0.695828,0.297336,0.293787},{0.808603,
     0.86753,0.370029},{0.07408,0.61986,0.331115},{0.381885,
     0.0654143,0.772265},{0.686679,0.732357,0.953552}}

The above expression is indeed equivalent to this one

In[3]:=
Table[Random[], {5}, {3}]

Out[3]=
{{0.178237,0.625166,0.754389},{0.279229,
     0.774446,0.29723},{0.508713,0.477397,0.695054},{0.601403,
     0.211377,0.18361},{0.886451,0.733873,0.841348}}

Regards,
Jean-Marc


  • Prev by Date: RE: Centering Text Cell
  • Next by Date: Re: RootSearch Performance
  • Previous by thread: Re: Tabling
  • Next by thread: Tabling