LinearAlgebra - Maple Programming Help

Home : Support : Online Help : Mathematics : Linear Algebra : LinearAlgebra Package : Constructors : LinearAlgebra/SubMatrix

LinearAlgebra

 SubMatrix
 construct a submatrix of a Matrix
 SubVector
 construct a subvector of a Vector

 Calling Sequence SubMatrix(A, r, c, options) SubVector(V, i, options)

Parameters

 A - Matrix r - integer, range with integer endpoints, or list of integers and/or ranges with integer endpoints; the indices of the Matrix rows used to construct the submatrix c - integer, range with integer endpoints, or list of integers and/or ranges with integer endpoints; the indices of the Matrix columns used to construct the submatrix V - Vector i - integer, range with integer endpoints, or list of integers and/or ranges with integer endpoints; the indices of the Vector elements used to construct the subvector options - (optional); constructor options for the result object

Description

 • The SubMatrix(A, r, c) function returns a Matrix created by using the entries of A that are in the intersection of the rows and columns specified by r and c. For more information regarding parameters r and c, see Matrix and Vector Entry Selection.
 • The SubVector(V, i) function returns a Vector created by using the entries of V that are specified by i. The orientation of the resulting subvector is the same as the orientation of V. For more information regarding parameter i, see Matrix and Vector Entry Selection.
 • The constructor options provide additional information (readonly, shape, storage, order, datatype, and attributes) to the Matrix or Vector constructor that builds the result. These options may also be provided in the form outputoptions=[...], where [...] represents a Maple list.  If a constructor option is provided in both the calling sequence directly and in an outputoptions option, the latter takes precedence (regardless of the order).
 • This function is part of the LinearAlgebra package, and so it can be used in the form SubMatrix(..) only after executing the command with(LinearAlgebra). However, it can always be accessed through the long form of the command by using LinearAlgebra[SubMatrix](..).

Examples

 > $\mathrm{with}\left(\mathrm{LinearAlgebra}\right):$
 > $A≔\mathrm{Matrix}\left(3,4,\left[\left[1,2,3,4\right],\left[5,6,7,8\right],\left[9,0,1,2\right]\right]\right)$
 ${A}{:=}\left[\begin{array}{rrrr}{1}& {2}& {3}& {4}\\ {5}& {6}& {7}& {8}\\ {9}& {0}& {1}& {2}\end{array}\right]$ (1)
 > $\mathrm{SubMatrix}\left(A,\left[-1,1\right],\left[2..4,3\right]\right)$
 $\left[\begin{array}{rrrr}{0}& {1}& {2}& {1}\\ {2}& {3}& {4}& {3}\end{array}\right]$ (2)
 > $V≔\mathrm{Vector}[\mathrm{row}]\left(\left[1,2,3,4,5,6\right]\right)$
 ${V}{:=}\left[\begin{array}{cccccc}{1}& {2}& {3}& {4}& {5}& {6}\end{array}\right]$ (3)
 > $\mathrm{SubVector}\left(V,\left[2,4..-1,1\right]\right)$
 $\left[\begin{array}{ccccc}{2}& {4}& {5}& {6}& {1}\end{array}\right]$ (4)
 > $\mathrm{SubVector}\left(V,3\right)$
 $\left[\begin{array}{c}{3}\end{array}\right]$ (5)