Fix bug (initial period in extended path).

extended_path was crashing in preceeded by a call to the set_time command.
time-shift
Stéphane Adjemian (Ryuk) 2021-06-15 14:22:54 +02:00
parent be38866487
commit edeb7911f3
Signed by: stepan
GPG Key ID: 295C1FE89E17EB3C
1 changed files with 8 additions and 2 deletions

View File

@ -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.