A matrix method for ordinary differential eigenvalue problems