Electrical stimulation of lobes of the brain and other sections of the brain. But the "mind" itself cannot leave the body. The mind is stimulated by outside stimulous but it cannot be usurped and replaced by something non-biological... the body dies.
In THE END the inhabitants of the matrix system are intact, but still jacked into the big machine in the safety of their individual pods.