[Date Index] [Thread Index] [Author Index]
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? > > --