[next][previous][up][top][index]
search for:

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 : x#10 = 555;
i7 : x_10

o7 = 555

Be careful not to assign a value to x itself if you wish to continue using it as a subscripted variable.

See also:

  • IndexedVariable -- the class of all indexed variables
  • IndexedVariableTable -- the class of indexed variable tables

  • [next][previous][up][top][index]
    search for: