MathGroup Archive 2005

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

Search the Archive

Re: Re: lists of variables

  • To: mathgroup at
  • Subject: [mg58270] Re: Re: lists of variables
  • From: Andrzej Kozlowski <andrzej at>
  • Date: Sat, 25 Jun 2005 01:56:28 -0400 (EDT)
  • References: <d9630u$q1t$><d9e10o$ge4$> <>
  • Sender: owner-wri-mathgroup at

On 24 Jun 2005, at 15:50, Ray Koopman wrote:

> dh wrote:
>> Hi Heath,
>> You already got many answers, but I think the solution to create
>> a variable name as a string and using ToExpression  is not the
>> appropriate way to do this.
>> Array[..] is made for this purpose.
> I agree that using ToExpression to construct code is awkward and tends
> to obscure what the code is, but for functions such as Minimize, that
> require names of variables in their calling sequence, how else would
> you handle problems in which the number of variables is not fixed?

If all you want  a list f variable length of symbols named in  
cunsecutive order and if you do not mind that the names may be  
different each time you run your program another possibility is to  
use something like:

vars = Unique /@ Table[t, {5}]

{t$22, t$23, t$24, t$25, t$26}

Andrzej Kozlowski

Chiba, Japan

  • Prev by Date: Re: a question about plot a list of functions.
  • Next by Date: Spline
  • Previous by thread: Re: lists of variables
  • Next by thread: lists of variables