@staticmethod
def list_from_matrix(A, m, n):
    """Convert a Matlab matrix to a Python list."""
    nlist = []
    for row in range(m):
        nlist.append([None] * n)
        for col in range(n):
            nlist[row][col] = A[row, col]
    return nlist
