Generalized Matrix Form of the Inverse Scattering Method