Added convenience method for taking the submatrix of a matrix