Page 1 of 1

Neglecting Error Messages

PostPosted: Thu Dec 01, 2011 3:53 pm
by timbuyse
Hello,

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.

Thanks,

Tim.

Re: Neglecting Error Messages

PostPosted: Thu Dec 01, 2011 7:25 pm
by jpfeifer
A possibility is to use "try ... catch". See http://www.dynare.org/phpBB3/viewtopic.php?f=1&t=3069

Re: Neglecting Error Messages

PostPosted: Fri Dec 02, 2011 8:56 am
by timbuyse
Thanks a lot for the quick reply!