MathGroup Archive 1999

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

Search the Archive

Re: Subscripted Variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg16434] Re: Subscripted Variables
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sat, 13 Mar 1999 02:21:46 -0500
  • References: <7c59n9$7nl@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Mitchell Kaplan wrote in message <7c59n9$7nl at smc.vnet.net>...
>I'd like to use subscripts to make my notation more readable.  I'm running
>Windows98 and used the template to add a subscript to a variable -- such as
>"x" with a subscript of "c".
>
>Everything works fine until I try to clear the values.  Normally I use the
>following statement to clear my values:
>Clear["Global`*"].  This doesn't seem to work on my subscripted variables.
>
>I then tried using them as local variables in a Block -- it didn't seem to
>recognize them as valid symbols.  Once I assign one of them, I can reset it
>by setting it equal to "." .  However, if I have a statement which sets all
>of them to "." I get error messages regarding ones that haven't yet been
>used.
>
>This is more of an inconvenience than a crisis, but I would really
>appreciate any help anyone could offer.
>
>Thanks,
>
>Mitchell
>

Mitchell

With
\!\(x\_1 = 5\);

The definition is not for x:

?x
"Global`x"

but for Subscript:

?Subscript
"System`Subscript"
Subscript[x, 1] = 5

The subscripted variable is not a symbol - hence it is rejected by Block;
and the stored definition is in Context "System`" - hence it is not cleared
by Clear["Clobal`*"].
Using Clear["System`*"] is not a good idea, but we can use use

Clear[Subscript]

?Subscript
"System`Subscript"

To make subcripted variables into proper symbols we can use  Add-ons>Extra
Utilities > Notation

---------------------
Allan Hayes
Mathematica Training and Consulting
Leicester UK
www.haystack.demon.co.uk
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565





  • Prev by Date: Re: Eliminating (-1)^2
  • Next by Date: Integral problem
  • Previous by thread: Re: Subscripted Variables
  • Next by thread: Re: Subscripted Variables