From 13544b513d55723fc6fa6f982399a6e31e11c022 Mon Sep 17 00:00:00 2001
From: Johannes Pfeifer <jpfeifer@gmx.de>
Date: Wed, 16 Oct 2024 11:38:26 +0200
Subject: [PATCH] dynare_estimation_init.m: add file type to exist statement

---
 matlab/estimation/dynare_estimation_init.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/estimation/dynare_estimation_init.m b/matlab/estimation/dynare_estimation_init.m
index 13c1c9e832..f51fb40d18 100644
--- a/matlab/estimation/dynare_estimation_init.m
+++ b/matlab/estimation/dynare_estimation_init.m
@@ -149,7 +149,7 @@ if ~isempty(bayestopt_) && any(bayestopt_.pshape==0) && any(bayestopt_.pshape~=0
     error('Estimation must be either fully ML or fully Bayesian. Maybe you forgot to specify a prior distribution.')
 end
 % Check if a _prior_restrictions.m file exists
-if exist([M_.fname '_prior_restrictions.m'])
+if exist([M_.fname '_prior_restrictions.m'],'file')
     options_.prior_restrictions.status = 1;
     options_.prior_restrictions.routine = str2func([M_.fname '_prior_restrictions']);
 end
-- 
GitLab