|
Contents | Previous | Next | Subchapters |
| Syntax |
matrix (row index, column index)
|
| See Also | base , elements , and vector elements |
m,
where m is the number of rows in the matrix.
Similarly, the column indices of a matrix are numbered from 1 to n,
where n is the number of columns in the matrix.
The expression x(2, 3) accesses the element in the
second row and third column of the matrix x. If you enter
x = {[1, 2, 3, 4], [5, 6, 7, 8]}
x(2, 3)
O-Matrix will respond
7
You can also use this notation to assign an element of an existing matrix.
The result has the type that corresponds to coercion
between
the type of the element and the original matrix.
x(1, 4) = 23d0
print type(x), x
results in
double {
[ 1 , 2 , 3 , 23 ]
[ 5 , 6 , 7 , 8 ]
}