We study the two-dimensional (2D) Ising model in a complex magnetic field in the vicinity of the Yang-Lee edge singularity. By using Baxter's variational corner transfer matrix method combined with analytic techniques, we numerically calculate the scaling function and obtain an accurate estimate of the location of the Yang-Lee singularity. The existing series expansions for susceptibility of the 2D Ising model on a triangular lattice by Chan, Guttmann, Nickel, and Perk allowed us to substantially enhance the accuracy of our calculations. Our results are in excellent agreement with the Ising field theory calculations by Fonseca, Zamolodchikov, and the recent work by Xu and Zamolodchikov. In particular, we numerically confirm an agreement between the leading singular behavior of the scaling function and the predictions of the M_{2/5} conformal field theory.