MathGroup Archive 2009

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

Search the Archive

Loop programming; how do i do this ???

  • To: mathgroup at
  • Subject: [mg96071] Loop programming; how do i do this ???
  • From: plzhlp <naso at>
  • Date: Wed, 4 Feb 2009 05:19:40 -0500 (EST)

I need to implement a function into my notebook but am having great difficulties even getting started (i'm new to mathematica and programming in general)

The function accepts a 1d array (of variable length) of integers

which will refer to a 2d array of constants, of which all need to be tested against eachother.

for example:

1DArrayVar = {2, 4, 5}

2DArrayCon = {


in this scenario will test:



    , {x, Length[DArrayCon[[2]]]
  , {y, Length[DArrayCon[[4]]]
, {z, Length[DArrayCon[[5]]]

So basically the problem is that i need a variable amount of nested loops, as the length of 1DArrayVar will always be unknown.

>From some research on the internet i've learned a recursive algorithm might be the solution, but i am completely lost on how to start --

any tips would be really appreciated !

  • Prev by Date: Re: Log[x]//TraditionalForm
  • Next by Date: Re: symbolic matrix manipulation
  • Previous by thread: Re: Log[x]//TraditionalForm
  • Next by thread: Re: Loop programming; how do i do this ???