I have a function that sets certain subscripts of the symbol aa as in the following example:
listA = { Subscript[aa,2], Subscript[aa,1,4,7], Subscript[aa,2,4,5,8] };
listB = {1,2,3};
Evaluate[listA]=listB
This causes Subscript[aa,2] = 1, etc. Later I wish to reuse the function, sometimes with some of the same downvalues of aa. But, first I must unset those downvalues.
I know I can clear ALL subscripted variables using Clear [ "Subscript" ]. But I need to clear only the subscripted values of the symbol aa while leaving other subscripted symbols alone. Is there a way to do something like the following?
Clear [ "Subscript[ aa ]" ] or Subscript[aa,u__]=. or
clear downvalues of aa
I suppose I could consider learning the Notation package, but all my functions involving subscripts are now working. I am just having this problem of re-using them during a single session.
{}button above the edit window. The edit window help button?is also useful for learning how to format your questions and answers. You may also find this meta Q&A helpful – Michael E2 Oct 12 '16 at 01:42Subscripts for display purposes, and not for calculational purposes. It is standard practice to use, e.g.aa[1],aa[1, 4, 7], etc. in place of theSubscripted versions. You can useFormatto have the front end displayaa[1]as a subscript while having it beaa[1]in the back end. – march Oct 12 '16 at 03:53Subscripts. Are you starting to see why using them as you are is discouraged? Is the effort really worth it compared to switching toaa[1]etc.? :p – Marius Ladegård Meyer Oct 12 '16 at 07:49