Contents Previous Next Subchapters

Sequential Elements Of A Vector
Syntax vector.blk(starting indexnumber)
See Also base , sequential rows or columns , and vector elements

Description
References the subvector with the specified starting index and number of elements, where starting index and number are integer scalars.

Tutorial
The value starting index specifies the first element of the subvector and the value number specifies the number of elements in the subvector. If you enter
     x = [4, 6, 8, 10]
     x.blk(2, 2)
O-Matrix will respond
     [ 6 , 8 ]
You can also use .blk to assign a subvector. The result has the type that corresponds to coercion between the type of the original vector and the subvector.
     x = {1, 2, 3, 4}
     x.blk(2, 3) = {5.5, 5.5, 5.5}
     x
results in
     {
     1
     5.5
     5.5
     5.5
     }