Natural and resonant oscillations of suspended circular graphene and hexagonal boron nitride (h-BN) membranes (single-layer sheets lying on a flat substrate having a circular hole of radius $R$) have been simulated using full-atomic models. Substrates formed by flat surfaces of graphite and h-BN crystal, hexagonal ice, silicon carbide 6H-SiC and nickel surface (111) have been used. The presence of the substrate leads to the forming of a gap at the bottom of the frequency spectrum of transversal vibrations of the sheet. The frequencies of natural oscillations of the membrane (oscillations localized on the suspended section of the sheet) always lie in this gap, and the frequencies of oscillations decrease by increasing radius of the membrane as $(R+R_i)^{-2}$ with nonezero effective increase of radius $R_i>0$. The modeling of the sheet dynamics has shown that small periodic transversal displacements of the substrate lead to resonant vibrations of the membranes at frequencies close to eigenfrequencies of nodeless vibrations of membranes with a circular symmetry. The energy distribution of resonant vibrations of the membrane has a circular symmetry and several nodal circles, whose number $i$ coincides with the number of the resonant frequency. The frequencies of the resonances decrease by increasing the radius of the membrane as $(R+R_i)^{\alpha_i}$ with exponent $\alpha_i<2$. The lower rate of resonance frequency decrease is caused by the anharmonicity of membrane vibrations.