Commit 10047fee authored by Stéphane Adjemian's avatar Stéphane Adjemian

Test if shocks are declared.

Fixes bug introduced in 97b894a1, if no shocks
are declared (for instance if the user is interested in the transition to the
steady state).
parent 97b894a1
...@@ -51,7 +51,7 @@ if options_.periods == 0 ...@@ -51,7 +51,7 @@ if options_.periods == 0
error('PERFECT_FORESIGHT_SETUP: number of periods for the simulation isn''t specified') error('PERFECT_FORESIGHT_SETUP: number of periods for the simulation isn''t specified')
end end
if options_.periods<max([M_.det_shocks.periods]) if ~isempty(M_.det_shocks) && options_.periods<max([M_.det_shocks.periods])
error('PERFECT_FORESIGHT_SETUP: number of periods for the simulation is specified to be smaller than the period of the last shock') error('PERFECT_FORESIGHT_SETUP: number of periods for the simulation is specified to be smaller than the period of the last shock')
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment