Simulation of the Magnetothermal Instability