def submatrix(matrix,i1,i2,j1,j2):
new = []<EOL>for i in range(i1,i2+<NUM_LIT:1>):<EOL><INDENT>new.append(matrix[i][j1:j2+<NUM_LIT:1>])<EOL><DEDENT>return _n.array(new)<EOL>
returns the submatrix defined by the index bounds i1-i2 and j1-j2

Endpoints included!