Eigenvalues and eigenvectors of some tridiagonal matrices with non-constant diagonal entries