Matlab and dynamic simulation