simulationA2.m