Matrix methods for Wentzell boundary conditions