next | previous | forward | backward | up | top | index | toc | Macaulay2 website
Macaulay2Doc > The Macaulay2 language > variables > subscripted variables

subscripted variables

It is common in mathematics to use subscripted variables. We use the underscore to represent subscripts. If we haven't assigned a value to x we may simply start using it as a subscripted variable. The subscripts can be anything.
i1 : x

o1 = x

o1 : Symbol
i2 : x_4

o2 = x
      4

o2 : IndexedVariable
i3 : x_(2,3)

o3 = x
      2,3

o3 : IndexedVariable
The .. operator knows what to do with subscripted variables.
i4 : x_10 .. x_20

o4 = (x  , x  , x  , x  , x  , x  , x  , x  , x  , x  , x  )
       10   11   12   13   14   15   16   17   18   19   20

o4 : Sequence
i5 : x_(1,1) .. x_(2,3)

o5 = (x   , x   , x   , x   , x   , x   )
       1,1   1,2   1,3   2,1   2,2   2,3

o5 : Sequence
Values can be assigned to these variables with =.
i6 : y_10 = 555;
i7 : y_10

o7 = 555

See also