Add code for simulation to MatLab file.