MathGroup Archive 2007

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

Search the Archive

Re: subscripted local variables?

  • To: mathgroup at
  • Subject: [mg80638] Re: subscripted local variables?
  • From: Szabolcs <szhorvat at>
  • Date: Tue, 28 Aug 2007 02:02:13 -0400 (EDT)
  • Organization: University of Bergen
  • References: <fath6p$3o7$>

Yaroslav Bulatov wrote:
> What is the recommended way of declaring subscripted local variables?
> For instance the following is an error in Mathematica 6.0
> Module[{Subscript[x, a]}, Subscript[x, a] = 5]

IMO, it is generally a bad idea to use subscripted variables in 
Mathematica, because you are assigning to Subscript[].  This leads to 
all kinds of problems, e.g. with clearing the variable.

Or try
z = Subscript[x, a]
a = 1
x = 2

Just use xa or x[esc]_[esc]a instead.  Subscripted variables are not 
worth the trouble.


  • Prev by Date: Re: Problem with With
  • Next by Date: Problems minimizing an overconstrained system
  • Previous by thread: subscripted local variables?
  • Next by thread: Re: subscripted local variables?