Getting errors from matlab after running dynare

It seems you are trying to loop over Dynare without catching errors. If your parameter draw is invalid, the respective fields of oo_ will not be set. Try using a try-catch statement or get the return code of stoch_simul. See also [Loop over parameters)