def octave_model_output(Q, eq):
    """
    Output an Octave-style matrix and vector assigned to 'Q' and a 'eq'.
    NOTE: It is the Q matrix, not the symmetric replacment rates as e.g. PAML
          and PhyML prefers.
    """
    q_str = '# name: Q\n# type: matrix\n# rows: 20\n# columns: 20\n'
    for row in Q:
        q_str += '  '.join(map(lambda e: str(round(e, 6)), row))
        q_str += '\n'
    eq_str = '# name: eq\n# type: matrix\n# rows: 1\n# columns: 20\n'
    eq_str += ' '.join(map(lambda e: str(round(e, 6)), eq))
    return q_str + '\n' + eq_str
