Contents Previous Next Subchapters

Sequence Operator
Syntax start : : finish
start : step : finish
See Also seq

Description
Creates a column vector in which the initial value is start, each successive element changes by a value of step, and the final value is finish, where start, step, and finish are integer, real, or double-precision scalars. If step is not specified, the value 1 is used in its place.

Tutorial
If you enter
     2 :: 4
O-Matrix will respond
     {
     2
     3
     4
     }
If you enter
     2 : 2 : 6
O-Matrix will respond
     {
     2
     4
     6
     }
The value step can also be negative. If you enter
     6 : -2 : 2
O-Matrix will respond
     {
     6
     4
     2
     }
The values can be integer, real, or double-precision. If you enter
     0 : .5 : 1.
O-Matrix will respond
     {
     0
     .5
     1.
     }

Reference
It is an error for step to be 0.

If step is less than 0 and start is greater than finish, the result is an empty matrix. In addition, if step is greater than 0 if start is less than finish, the result is an empty matrix. For example, if you enter
     1 : 1 : 0
O-Matrix will respond
     { }
which signifies a matrix with no rows.

If start, step, and finish are not of the same type, O-Matrix will coerce the values as detailed in the coercion section.