Fabry-Perot cavities and matching slabs implemented in time-domain by using time-varying metamaterials