:

Operators ››
Parent Previous Next

:

a = x : y

Make an array a beginning from x to y with step of 1 or -1

a = x : y : z

Make an array a beginning from x to z with step of y

Commutative

No

Data Types

x

y

z

SCAL

SCAL

SCAL

Notes

  • In x:y, the step size is either 1, if x < y, or -1, if x > y. Note that this is different from the MATLAB convention.

Examples

AUX> 1:5

ans = 1 2 3 4 5

AUX> 5:1

ans = 5 4 3 2 1

AUX> 1:.5:3

ans = 1 1.5 2 2.5 3

Created with the Personal Edition of HelpNDoc: Create iPhone web-based documentation