matlab code in simulating exit