MathGroup Archive 2005

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

Search the Archive

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

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60743] N-nested For loops, with N variable - Best way to implement?
  • From: lost.and.lonely.physicist at gmail.com
  • Date: Tue, 27 Sep 2005 03:45:15 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

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?