# Command: Range

NEST HelpDesk | Command Index | NEST Quick Reference

Name:

    Range - Generate array with range of numbers
      Synopsis:  [N] Range  -> [1 ... N]
      [N1 N2] Range -> [N1 ... N2]
      [N1 N2 d] Range -> [N1 N1+d N1+2d ...]

Examples:

      [5] Range   -> [1 2 3 4 5]
      [2 5] Range   -> [2 3 4 5]
      [5 2] Range   -> []
      [5 2 -1] Range -> [5 4 3 2]
      [1.0 10.0 2.5] Range -> [1 3.5 6 8.5]

Description:

      Range accepts an array which contains either
      1) a single integer
      2) an interval specified by two integers or two doubles
      3) an interval and a stepsize, specified by three integers or
      three doubles.

      Range generates an array with numbers which are in the specified
      range. The type of the result corresponds to the type used for
      specifying the interval.

      Range returns an empty array if the set specified by N1, N2 and d
      does not contain any element. This behavior is essential if
      Range is used in combination with functional operators like
      FoldList and NestList.

Bugs:

Remarks:

    Resembles the function Range of Mathematica

Author:

    Gewaltig, Diesmann

SeeAlso:

- LayoutArray
- Table
- array
- zeros
- ones
- Map

Source:

    /opt/conda/conda-bld/nest_1531570948828/work/lib/sli/mathematica.sli

NEST HelpDesk | Command Index | NEST Quick Reference

© 2004 The NEST Initiative