Isospectral matrices and classical polynomials