Neglecting Error Messages


I am trying to run dynare as part of another .m file in Matlab. This .m file is built to give certain parameter values to Dynare, after which I let dynare compute the steady state for my model. In a second step, I want to use these steady state values for computations, which are stated in the original .m file. However, It is clear that for some parameter value combinations, Dynare gives an error message (maxit reached, or others) because these combinations are not compatible with a steady state. I now this in advance that I will get an error for some combinations of parameter values.

Now, in case of an error, Dynare interrupts the procedure and gives no values for the steady state (as there is no steady sate), hence my original .m file can not continue working. I would like to solve this as follows:

In case there is an error of any kind, I would like that Dynare gives me some output for the steady state (like ‘NA’ or ‘0’) , without interrupting the original .m file.

I was wondering if there is any way to realize this.



A possibility is to use “try … catch”. See [Not stopping the algorithm after violation of BK-conditions)

Thanks a lot for the quick reply!