Clear the value of a subscripted variable?

I defined K_b:

In[34]:= Subscript[K, b] = x y

Out[34]= x y

In[35]:= Subscript[K, b]

Out[35]= x y

but then decided to clear the value (so I can later change the assignment to an equation ==).

In[36]:= Clear[Subscript[K, b]]

During evaluation of In[36]:= Clear::ssym: Subscript[K, b] is not a symbol or a string.

Why did this fail? ClearAll didn’t work either.

Use:

Subscript[k, b] =.

I would stay away from subscripted symbols, because it may cause problems when substituting things as it is not seen as a single symbol:

Subscript[k, b] /. k -> 3

gives

3_b

There is a general advice against the use of subscripts - as Sander did, because:

I you make an assignment like this

Subscript[k, b] = 1;
a = 2;

then with “normal” symbols OwnValues are created - but not in the case of Subscript:

Instead the assignment to Subscript went (as kind of a function definition!) into DownValues:

dv.png

The only meaningful use of Subscript is (typically at the very end of a calculation) for displaying reasons.

Does that help? Regards – Henrik

I’ve said it before: you should think of Subscript as a typographical construct.

OK, thanks for the comments!
-Jon