Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]

Subscript Ranges


Subscript ranges are used to select a subarray from an array by giving the starting and ending subscripts of the subarray in each dimension. Subscript ranges can be combined with scalar and array subscripts and with other subscript ranges. Any rectangular portion of an array can be selected with subscript ranges. There are six types of subscript ranges:

Multidimensional subarrays can be specified using any combination of the above forms. For example, arr[*, 0:4] is made from all columns of rows 0 to 4 of arr or a 10-column, 5-row array. The table below summarizes the possible forms of subscript ranges:

Form
Description
e
A simple subscript expression
e 0:e 1
Subscript range from e 0 to e 1
e 0:e 1:e 2
Subscript range from e 0 to e 1 with a stride of e 2
e 0:*
All points from element e 0 to end
e 0:*:e 2
All points from element e 0 to end with a stride of e 2
*
All points in the dimension


Home | Categories | Alphabetical | Classes | All Contents | [ < ] | [ > ]