4

Possible Duplicate:
Clear complains that a variable is not a symbol or a string?

Clear["Global*"]` Works for most variables, however if i do something like

$ \delta_a = \alpha_a \Delta T d $

Then the Clear or ClearAll will not clear $ \delta_a $, short of Quit[] is there anything that can be done to clear variables with subscripts?

user160917
  • 151
  • 1
  • 6

2 Answers2

9

Try Remove.

Subscript[x, k_] = 1/k^2;
Clear[x]
Subscript[x, 2]
Remove[x]
Subscript[x, 2]
rcollyer
  • 33,976
  • 7
  • 92
  • 191
Mark McClure
  • 32,469
  • 3
  • 103
  • 161
6

Well. You can always clear a certain value by using Unset

Subscript[r, 3]=8;
Subscript[r, 3]=.;

Now, Clear and ClearAll won't work if you used regular = and assigned the values as Subscript's DownValues. But if you used UpValues, it could work

r/:Subscript[r, 3]=8;
ClearAll[r];
Rojo
  • 42,601
  • 7
  • 96
  • 188