This article simulates the coupling processes of electromagnetic pulse into a cavity with a slot, and utilizes the uniaxial anisotropic perfectly matched layer (UPML) as absorbing boundary condition to truncate the calculation region by a finite difference time domain method (FDTD). According to the calculation of electric field and its frequency domain characteristic of some special grids, the rules of electromagnetic pulse coupling into a cavity with a slot are obtained. The result shows that uniaxial anisotropic perfectly matched layer is effective in serving as absorbing boundary.