def convert_matrix(matrix):
    row = matrix.matrix_row()
    tmp = []
    rows = 0
    for r in row:
        tmp.append([])
        for expr in r.expr():
            tmp[rows].append(convert_expr(expr))
        rows = (rows + 1)
    return sympy.Matrix(tmp)
def convert_matrix(matrix):
    row = matrix.matrix_row()
    tmp = []
    rows = 0
    for r in row:
        tmp.append([])
        for expr in r.expr():
            tmp[rows].append(convert_expr(expr))
        rows = (rows + 1)
    return sympy.Matrix(tmp)