Contents Previous Next Subchapters Current Chapters-> vectorelem matrixelem rowcol seqrowcol seqsubvec subblock nonseq vecind endexp base colbase rowbase Parent Chapters-> Omatrix6 submatrices subblock Search Tools-> contents reference index search

Accessing A Subblock Of A Matrix
 Syntax matrix`.blk(`starting row`, `starting column`, `rows`, `columns`)` See Also base , sequential subvectors

Description
References the subblock with upper-left corner at the specified starting row and column, with the specified number of rows and columns, where starting row, starting column, rows and columns are integer scalars. (If starting row, starting column, rows, or columns, is real, or double-precision, it is interpreted as an integer using the same convention as in the int function. )

Tutorial
If you enter ```      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 ]      } ```