Running Dynare in a Matlab loop

See here [Designing probability outside the model)