linalg(deprecated)/submatrix - Maple Help

linalg(deprecated)

 submatrix
 extract a specified submatrix from a matrix

 Calling Sequence submatrix(A, Rrange, Crange) submatrix(A, Rlist, Clist)

Parameters

 A - matrix Rrange, Crange - integer ranges of rows/columns of A Rlist, Clist - lists of integer row/column indices

Description

 • 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.

Examples

Important: The linalg package has been deprecated. Use the superseding command LinearAlgebra[SubMatrix], instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $A≔\mathrm{array}\left(\left[\left[1,2,3\right],\left[4,x,6\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {4}& {x}& {6}\end{array}\right]$ (1)
 > $\mathrm{submatrix}\left(A,1..2,2..3\right)$
 $\left[\begin{array}{cc}{2}& {3}\\ {x}& {6}\end{array}\right]$ (2)
 > $\mathrm{submatrix}\left(A,\left[2,1\right],\left[2,1\right]\right)$
 $\left[\begin{array}{cc}{x}& {4}\\ {2}& {1}\end{array}\right]$ (3)
 > $\mathrm{submatrix}\left(A,\left[2,1\right],1..2\right)$
 $\left[\begin{array}{cc}{4}& {x}\\ {1}& {2}\end{array}\right]$ (4)