From 781e2806102f505652eab955e226639a666b89c9 Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Wed, 25 Mar 2015 09:42:59 +0100 Subject: [PATCH] Prevent crash if steady state cannot be computed If e.g. the log of the steady state cannot be computed, the field oo_.dr.ys does not exist --- matlab/stoch_simul.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matlab/stoch_simul.m b/matlab/stoch_simul.m index c90bc1a5e..e9a4e5e2d 100644 --- a/matlab/stoch_simul.m +++ b/matlab/stoch_simul.m @@ -82,7 +82,7 @@ else [oo_.dr,info,M_,options_,oo_] = resol(0,M_,options_,oo_); end -if options_.loglinear %log steady state for correct display of decision rules and simulations +if options_.loglinear && isfield(oo_.dr,'ys') %log steady state for correct display of decision rules and simulations oo_.dr.ys=log(oo_.dr.ys); oo_.steady_state=log(oo_.steady_state); options_old.logged_steady_state = 1;