diff --git a/matlab/dynare_estimation_1.m b/matlab/dynare_estimation_1.m
index 31762e9a74f2655476b560fa8f37ecdf4100950b..2f4eabed576c1f787e51c0cb4d30b122259715ac 100644
--- a/matlab/dynare_estimation_1.m
+++ b/matlab/dynare_estimation_1.m
@@ -524,6 +524,8 @@ if options_.mode_compute > 0 & options_.posterior_mode_estimation
                 else
                     hh = reshape(hessian('DsgeVarLikelihood',xparam1,options_.gstep,gend),nx,nx);
                 end
+            else
+                nn = repmat(NaN,length(xparam1),length(xparam1))
             end
         end
         if options_.cova_compute