Matrix variational method for electron-atom scattering