From 91cf1d59f89da415c2552b7175491b51a867a863 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien@dynare.org>
Date: Wed, 30 Apr 2025 12:07:21 +0200
Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Perfect=20foresight=20with=20con?=
 =?UTF-8?q?trolled=20paths:=20no=20longer=20crash=20with=20homotopy=5Fexcl?=
 =?UTF-8?q?ude=5Fvarexo=20option=20and=20multiple=20controlled=20variables?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 matlab/perfect-foresight-models/perfect_foresight_solver.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/matlab/perfect-foresight-models/perfect_foresight_solver.m b/matlab/perfect-foresight-models/perfect_foresight_solver.m
index 1f8e967b0f..e9012634a1 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_solver.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_solver.m
@@ -567,7 +567,7 @@ if ~isempty(controlled_paths_by_period)
         % Handle guess values for endogenized exos
         exo_ids = controlled_paths_by_period(p).endogenize_id;
         if ~isempty(options_.simul.homotopy_exclude_varexo)
-            [is_excluded, excluded_exo_ids] = ismember(options_.simul.homotopy_exclude_varexo, M_.exo_names{exo_ids});
+            [is_excluded, excluded_exo_ids] = ismember(options_.simul.homotopy_exclude_varexo, M_.exo_names(exo_ids));
             if any(is_excluded)
                 error('Exogenous %s cannot be in the homotopy_exclude_varexo option and a perfect_foresight_controlled_paths block at the same time', M_.exo_names{excluded_exo_ids(1)})
             end
-- 
GitLab