Update simulate.m