MathGroup Archive 2001

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

Search the Archive

Re: Clearing Subscripted Variables?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg31444] Re: Clearing Subscripted Variables?
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 7 Nov 2001 05:29:01 -0500 (EST)
  • Organization: Universitaet Leipzig
  • References: <9s1usi$o4p$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

For[i = 0, i < 10, i++, Subscript[f, i] =.]

?

If you like that

DownValues[Subscript] = 
  Select[
    DownValues[Subscript], 
    ! MatchQ[#, Verbatim[HoldPattern][Subscript[f, _]] :> _] &
   ]

more, it also works.

It's better to associate the subscripts with f than with Subscript[],
and use

For[i = 0, i < 10, i++, f /: Subscript[f, i] = 0]

to clear this you can now use Clear[f].


Regards
  Jens

Randall Edick wrote:
> 
> Math Group,
> 
> I initialized a set of subscripted variables
> 
> For[i=0,i<10,i++,Subscript[f,i]=0]
> 
> Then, can't Clear or Unset the values.  Things such as Clear["Global`*"]
> don't work.  Why?
> I guess its being replaced by the value 0 before the Clear.  How can I stop
> that (I guess
> SetDelayed would have work better) but how can I lose this definition?
> 
> --



  • Prev by Date: Re: lists w/o double brackets
  • Next by Date: Re: image in PDF file
  • Previous by thread: Re: Clearing Subscripted Variables?
  • Next by thread: Plot in Mathematica 4.0