Message Boards Message Boards


Subscripted and superscripted symbols as symbols

Posted 9 years ago
1 Reply
0 Total Likes

I want subscripted, superscripted symbols used as symbols themselves.

Subscripted : I tried this and it works, Subscript[M, 5][x_] := x^2

It doesn't work for Superscript, because it interprets as raised to the power I have both subscript and superscript

In[91]:= (M1^5)[t_] := t

During evaluation of In[91]:= SetDelayed::write: Tag Power in (M1^5)[t_] is Protected. >>

Out[91]= $Failed

If this is the case how can I use both subscript and superscript?

POSTED BY: White Sky

Please see these articles covering how to use subscripted expressions as variables: Subscript[M,5] is not a symbol, but an expression. This will make things confusing.

I very much recommend avoiding using Subscript or SuperScript or the like while writing code unless you are already familiar with what is outlined in the two articles above.

To answer your exact question, you want to use SubSuperScript:

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract