  We present and experimentally verify a matrix approach for determining how to
optimally sculpt an input wavefront both in space and time for any desired
wave-control functionality, irrespective of the complexity of the wave
scattering. We leverage a singular value decomposition of the transport matrix
that fully captures how both the spatial and temporal degrees of freedom
available to shape the input wavefront impact the output wavefront's spatial
and temporal form. In our experiments in the microwave domain, we use our
formalism to successfully tackle three iconic wave-control tasks in a
disordered cavity: (i) reflectionless transient excitation (``virtual perfect
absorption''), (ii) optimal energy deposition, and (iii) scattering-invariant
time-varying states.
