Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Construction  /
Range

  • Range[ imax ] generates the list 1, 2, ... , imax .
  • Range[ imin , imax ] generates the list imin , ... , imax . Range[ imin , imax , di ] uses step di.
  • Example: Range[4].
  • The arguments to Range need not be integers.
  • Range starts from imin, and successively adds increments of di until the result is greater than imax.
  • Range[0, 1, .3].
  • Range[x, x+2].
  • Range uses the standard Mathematica iteration specification, as applied to a single variable.
  • See the Mathematica book: Section 1.8.3.
  • See also: Table, Interval, CharacterRange.

    Further Examples

    Here are lists of integers from 1 to 12, 5 to , and to conuting by threes.

    In[1]:=

    Out[1]=

    In[2]:=

    Out[2]=

    In[3]:=

    Out[3]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.