|
Contents | Previous | Next | Subchapters |
| Syntax |
matrix.blk(starting row, starting column, rows, columns)
|
| See Also | base , sequential subvectors |
x = {[1, 2, 3, 4], [5, 6, 7, 8]}
x.blk(1, 2, 2, 3)
O-Matrix will respond
{
[ 2 , 3 , 4 ]
[ 6 , 7 , 8 ]
}
You can also use .blk to assign a submatrix.
The result will have the type that corresponds to coercion
between the type of the original matrix and the subblock.
Continuing the example above
x.blk(1, 2, 2, 2) = fill(6.6, 2, 2)
print x
results in
{
[ 1 , 6.6 , 6.6 , 4 ]
[ 5 , 6.6 , 6.6 , 8 ]
}