MathGroup Archive 2009

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

Search the Archive

Modify variable names in a loop

  • To: mathgroup at smc.vnet.net
  • Subject: [mg101744] Modify variable names in a loop
  • From: Parita <parita.patel at gmail.com>
  • Date: Thu, 16 Jul 2009 08:15:54 -0400 (EDT)

Hi

I would like to modify the variable name in a loop and assign values
to the variable.

For[kk = 1, kk <= 3, kk++,
    "output" <> ToString[Evaluate[kk]] = {kk,kk+1,kk+2};
];

I would like the following output
output1={1,2,3}
output2={2,3,4}
output3={3,4,5}

Although, "output" <> ToString[Evaluate[kk]] evaluates as expected, it
does not let me assign values. Am I missing something here?

Thanks in advance for your help


  • Prev by Date: Re: Re: NDSolve problem
  • Next by Date: Re: Determine if a parameter is a function
  • Previous by thread: Maximize question
  • Next by thread: Re: Modify variable names in a loop