MathGroup Archive 2000

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

Search the Archive

Re: Clear or remove definitions including Subscripts


Sanchez,

Definitions like

Clear["`*"]

Subscript[a, 11] = 5;
Subscript[a, 12] = 7;

Can be removed individually by using Unset, for example (with short
notation)

Subscript[a, 11] =.
Subscript[a, 11]

        Subscript[a, 11]



But they are all stored under (tagged by) Subscript, so we can clear all
definitions tagged by Subscript by

Clear[Subscript]

Another approach is to tag the definions by a, thus

a /: Subscript[a, 11] = 5;
a /: Subscript[a, 12] = 7;

We can still unset them individually

a /: Subscript[a, 11] =.
Subscript[a, 11]

        Subscript[a, 11]


And we can clear them all definions tagged by a

Clear[a]
Subscript[a, 12]

        Subscript[a, 12]


--
Allan
---------------------
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

"SANCHEZ DE LEON, Guillermo" <gsl at fab.enusa.es> wrote in message
news:8djl1m$7j6 at smc.vnet.net...
> Dear friends,
>
> If I write:
>
> In[1]:= Subscript[a, 11];
> In[2]:= Subscript[a, 12];
>
> Q1: How I can Clear or Remove the previous definitions?.
> Q2: Is it posible to clear at the same time all definitions with pattern:
> Subscript[a, i] (* i=1,2,..*)
>
> I wish to avoid using Notation Package
>
> I have tested:
>
> In[3]: Clear[Subscript[a, 11]]
> Message: Clear:: "ssym": a_11 is not a symbol or a string
>
> In[4]: Clear["\!\(a\_11\)"]
>
> But they don`t work
>
>
>
>




  • Prev by Date: RE: Piecewise functions
  • Next by Date: Re: PrintPrecision
  • Previous by thread: Re: Clear or remove definitions including Subscripts
  • Next by thread: RE: Clear or remove definitions including Subscripts