MathGroup Archive 2005

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

Search the Archive

N-nested For loops, with N variable - Best way to implement?


Hello everyone

I'd like to seek some advice regarding how to best implement N nested
For loops such that

(1) N is a variable - i.e. I tell Mathematica what N is and it does the
For loop N times.

(2) For each loop I want to do something like For[a_k=1,a_k<=A,a++,
...], k = 1,...,N and I want to use the all the running values
{a_1,...,a_N} to do stuff within the innermost loop.

Maybe there's even a way to do this w/o using For loops? Table maybe?

Thanks for the advice.


  • Prev by Date: Problem running multiple lines in a cell
  • Next by Date: Using the solution of a differential equation and minimizing the solution.
  • Previous by thread: Re: Problem running multiple lines in a cell
  • Next by thread: Re: N-nested For loops, with N variable - Best way to implement?