Maptitude GISDK Help |
Extracts a number of elements from a vector.
Added to Version 2014.
sub_vector = SubVector(vector v, integer start, integer length)
Argument |
Contents |
v |
The input vector |
start |
The position of the first element extracted |
length |
The number of elements extracted |
A vector containing the specified elements of v, or null, if start and length do not specify any elements.
If start is null, SubVector() extracts from the beginning of v.
If length is null, SubVector() returns all the elements of the vector beginning with start.
SubVector() does not modify v; it creates a new vector containing a subset of the elements.
a = {1,1,3,4,5}
v = a2v(a)
v2 = SubVector(v, 2, 3) // v2 = [1,3,4]
Error Type |
Meaning |
Error |
Start is less than one, or length is less than zero |
Function |
Summary |
Copies an array to a vector |
|
|
|
Copies a vector to a new vector |
|
Constructs a cumulative vector in a new vector |
|
Sorts the elements of a vector in ascending order |
|
Sorts an array of vectors in ascending order, based on the first vector |
|
Transposes an array of arrays, where element b[i][j] = a[j][i] |
|
Creates a vector |
|
Copies a vector to an array |
©2025 Caliper Corporation | www.caliper.com |