The results of experimental studies and modeling calculations for controlling the transverse dimensions of an electron beam formed by a magnetron gun with a secondary emission cathode are presented. In the gun, the secondary emission process is launched by a voltage pulse with an amplitude of up to 15 kV supplied to its anode. The dependence of the radial dimensions of the electron beam on the amplitude and gradient of the magnetic field in the transport channel is investigated. It is shown that the obtained experimental results are consistent with the simulation results. The possibility of adjusting the beam diameter by varying the configuration of the magnetic field is established. The experimental results presented indicate the possibility of realizing irradiation of the outer surface of cylindrical samples placed in the region of the gradient magnetic field.