4
$\begingroup$

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?

$\endgroup$
0

2 Answers 2

6
$\begingroup$

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];
$\endgroup$
7
$\begingroup$

Try Remove.

Subscript[x, k_] = 1/k^2;
Clear[x]
Subscript[x, 2]
Remove[x]
Subscript[x, 2]
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.