submatrix(a, r1, c1, r2, c2)

Returns a submatrix of matrix a with corner entries (r1,c1) and (r2,c2).


See also matrix row column 


Example


a = ( 3, 5, 7, 8 ; 3, 4, 7,-4 ; 2, 4, -1, 1 ; 1, 2, -3, -7 )

3  5   7   8

3  4   7  -4

2  4  -1   1

1  2  -3  -7

submatrix( a, 2, 2, 4, 3 )

4   7

4  -1

2  -3