Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Table Iterators

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52635] Re: Table Iterators
  • From: Peter Pein <petsie at arcor.de>
  • Date: Sun, 5 Dec 2004 02:08:13 -0500 (EST)
  • References: <cos193$dm8$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Gregory Lypny wrote:

> Hello Everyone,
> 
> I need to create many tables, all with the same iterators {i, iMin, 
> iMax, di}, {j, jMin, jMax, dj}.  I'd like to be able to set the 
> iterators outside of the Table function so that I can change them and 
> have all of the tables change accordingly.
> 
> I've tried
> 
> rowDim:= {i, iMin, iMax, di} and colDim:={j, jMin, jMax, dj} inside of 
> Table[stuff,rowDim,colDim]
> 
> but this generates an iterator error.
> 
> Any suggestions would be most appreciated.
> 
> 	Greg
> 
In[1]:=
rowDim := {i, 1, 10, 3};
colDim := {j, 2, 8, 2};
Attributes[Table]
Table[stuff[i, j], Evaluate[rowDim], Evaluate[colDim]]
Out[3]=
  {HoldAll, Protected}
(*^^^^^^^*)
Out[4]=
{{stuff[1, 2], stuff[1, 4], stuff[1, 6], stuff[1, 8]},
  {stuff[4, 2], stuff[4, 4], stuff[4, 6], stuff[4, 8]},
  {stuff[7, 2], stuff[7, 4], stuff[7, 6], stuff[7, 8]},
  {stuff[10, 2], stuff[10, 4], stuff[10, 6], stuff[10, 8]}}

-- 
Peter Pein
10245 Berlin


  • Prev by Date: Re: Table Iterators
  • Next by Date: Re: Solve given that a variable is between 0 and 1
  • Previous by thread: Re: Table Iterators
  • Next by thread: Complex Analysis using Mathematica