From edeb7911f3ace660277ab9493174ddc11bd3c7bc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Ryuk=29?= <stepan@adjemian.eu>
Date: Tue, 15 Jun 2021 14:22:54 +0200
Subject: [PATCH] Fix bug (initial period in extended path).

extended_path was crashing in preceeded by a call to the set_time command.
---
 matlab/ep/extended_path.m | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/matlab/ep/extended_path.m b/matlab/ep/extended_path.m
index e656048751..c45ac13b74 100644
--- a/matlab/ep/extended_path.m
+++ b/matlab/ep/extended_path.m
@@ -86,10 +86,16 @@ end % (while) loop over t
 dyn_waitbar_close(hh);
 
 % Set the initial period.
-if isnan(DynareOptions.initial_period)
+if isdates(DynareOptions.initial_period)
+    if ischar(DynareOptions.initial_period)
+        initial_period = dates(DynareOptions.initial_period);
+    else
+        initial_period = DynareOptions.initial_period;
+    end
+elseif isnan(DynareOptions.initial_period)
     initial_period = dates(1,1);
 else
-    initial_period = DynareOptions.initial_period;
+    error('Type of option initial_period is wrong.')
 end
 
 % Return the simulated time series.
-- 
GitLab