Submatrix

Submatrix

Extracts a part of a matrix or a table. Can be used to take individual rows and columns or arbitrarily sized portions of a bigger matrix or table. The tool supports both fixed-size and variable-size submatrices. An attempt to take a submatrix that would exceed the size of the input causes a run-time error.

Inputs

matrix
An input matrix or table.
row
The zero-based index of the first column of the submatrix. Negative numbers count from the end: -1 means last and so on.
column
The zero-based index of the first row of the submatrix. Negative numbers count from the end: -1 means last and so on.
rows
The number of rows in the submatrix. Negative numbers are treated as indices from the end: -1 means up to (and including) the last row.
columns
The number of columns in the submatrix. Negative numbers are treated as indices from the end: -1 means up to (and including) the last column.

Outputs

submatrix
The extracted submatrix.