MathGroup Archive 2001

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

Search the Archive

Re: Clearing Subscripted Variables?


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