Simulations of the MAGIC telescopes with matelsim