def parse_matrix(matrix_text):
    """Parse a matrix returning cell, a and u matrix."""
    tokens = map(float, matrix_text.replace('-', ' -').split()[:30])
    cell = tokens[21:27]
    a = tokens[0:9]
    u = tokens[12:21]
    return cell, a, u
