# submatrix' -- exclude rows and/or columns of a matrix

## Synopsis

• Usage:
submatrix'(f, rows, cols)
submatrix'(f,,cols)
submatrix'(f,cols)
submatrix'(f,rows,)
• Inputs:
• f, a map between free modules
• rows, , a list of integers denoting the choice of rows to exclude. If omitted, exclude no rows
• cols, , a list of integers denoting the choice of columns to exclude. If omitted, exclude no columns
• Outputs:
• , the submatrix of f with rows and cols left out

## Description

Each list of integers may contain ranges and repetitions, as in {3, 5..7, 3:0}. Excluding a row or column more than once is allowed but has no extra effect.

 i1 : R = ZZ/101[a .. o]; i2 : f = genericMatrix(R, a, 3, 5) o2 = | a d g j m | | b e h k n | | c f i l o | 3 5 o2 : Matrix R <--- R i3 : submatrix'(f, {1}, {2}) o3 = | a d j m | | c f l o | 2 4 o3 : Matrix R <--- R i4 : submatrix'(f, {1}, {2,3,3,2,2}) o4 = | a d m | | c f o | 2 3 o4 : Matrix R <--- R

 i5 : submatrix'(f, {1,3}, ) o5 = | a d g j m | | c f i l o | 2 5 o5 : Matrix R <--- R i6 : submatrix'(f, , {1,3} ) o6 = | a g m | | b h n | | c i o | 3 3 o6 : Matrix R <--- R i7 : submatrix'(f, {1,3} ) o7 = | a g m | | b h n | | c i o | 3 3 o7 : Matrix R <--- R

## Ways to use submatrix' :

• "submatrix'(Matrix,Nothing,VisibleList)"
• "submatrix'(Matrix,VisibleList)"
• "submatrix'(Matrix,VisibleList,Nothing)"
• "submatrix'(Matrix,VisibleList,VisibleList)"

## For the programmer

The object submatrix' is .