<?xml version="1.0" encoding="utf-8" ?> <!-- for emacs: -*- coding: utf-8 -*- --> <!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head><title>subscripted variables</title> <link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/> </head> <body> <table class="buttons"> <tr> <td><div><a href="_numbered_spvariables.html">next</a> | <a href="_viewing_spthe_spsymbols_spdefined_spso_spfar.html">previous</a> | <a href="_numbered_spvariables.html">forward</a> | <a href="_viewing_spthe_spsymbols_spdefined_spso_spfar.html">backward</a> | <a href="_variables.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div> </td> </tr> </table> <div><a href="index.html" title="">Macaulay2Doc</a> > <a href="___The_sp__Macaulay2_splanguage.html" title="">The Macaulay2 language</a> > <a href="_variables.html" title="The variables of a complex or co-complex.">variables</a> > <a href="_subscripted_spvariables.html" title="">subscripted variables</a></div> <hr/> <div><h1>subscripted variables</h1> <div>It is common in mathematics to use subscripted variables. We use the underscore to represent subscripts. If we haven't assigned a value to <tt>x</tt> we may simply start using it as a subscripted variable. The subscripts can be anything.<table class="examples"><tr><td><pre>i1 : x o1 = x o1 : Symbol</pre> </td></tr> <tr><td><pre>i2 : x_4 o2 = x 4 o2 : IndexedVariable</pre> </td></tr> <tr><td><pre>i3 : x_(2,3) o3 = x 2,3 o3 : IndexedVariable</pre> </td></tr> </table> The <a href="_...html" title="a binary operator, used for sequences of consecutive items">..</a> operator knows what to do with subscripted variables.<table class="examples"><tr><td><pre>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</pre> </td></tr> <tr><td><pre>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</pre> </td></tr> </table> Values can be assigned to these variables with <a href="__us.html" title="a binary operator, used for subscripting and access to elements">_</a>.<table class="examples"><tr><td><pre>i6 : y_10 = 555;</pre> </td></tr> <tr><td><pre>i7 : y_10 o7 = 555</pre> </td></tr> </table> </div> <div class="single"><h2>See also</h2> <ul><li><span><a href="___Indexed__Variable.html" title="the class of all indexed variables">IndexedVariable</a> -- the class of all indexed variables</span></li> </ul> </div> </div> </body> </html>