Contents  Previous  Next  Subchapters 
Syntax 
vector ( index )

See Also  elements , base , sequential subvectors , and matrix elements 
n
,
where n
is the number of elements in the vector.
The expression x(2)
accesses the second element of the
vector x
. If you enter
x = [3, 5, 7]
x(2)
OMatrix will respond
5
You can also use this notation to assign an element of an existing vector.
The result has the type that corresponding to coercion
between
the type of the original matrix and the type of the element.
x = [1, 2, 3]
x(2) = 4.4
print type(x), x
results in
real [ 1 , 4.4 , 3 ]