linalg(deprecated)
submatrix
extract a specified submatrix from a matrix
Calling Sequence
Parameters
Description
Examples
submatrix(A, Rrange, Crange)
submatrix(A, Rlist, Clist)
A
-
matrix
Rrange, Crange
integer ranges of rows/columns of A
Rlist, Clist
lists of integer row/column indices
Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[SubMatrix], instead.
- For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
The call submatrix(A, Rrange, Crange) returns the submatrix of A selected by the row range Rrange and the column range Crange.
The call submatrix(A, Rlist, Clist) returns the matrix whose (i,j)th element is A[Rlist[i], Clist[j]].
These calling methods can be combined, so for instance the call submatrix(A, Rlist, Crange) is valid, and will return the submatrix of A with rows from Rlist and columns from Crange.
The command with(linalg,submatrix) allows the use of the abbreviated form of this command.
with⁡linalg:
A≔array⁡1,2,3,4,x,6
A≔1234x6
submatrix⁡A,1..2,2..3
23x6
submatrix⁡A,2,1,2,1
x421
submatrix⁡A,2,1,1..2
4x12
See Also
linalg(deprecated)[row]
linalg(deprecated)[subvector]
LinearAlgebra
Download Help Document