gui: rework transitory shocks

time-shift
Houtan Bastani 2019-02-07 15:57:53 +01:00
parent aef31e25e8
commit 922536e4ea
No known key found for this signature in database
GPG Key ID: 000094FB955BE169
1 changed files with 10 additions and 4 deletions

View File

@ -93,10 +93,16 @@ if nargout == 1
end
%% SHOCKS instructions (for transitory shocks)
if jm.transitoryshockexist == 1
for exotriter = 1:length(jm.shocksdescription)
currenttrshock = jm.shocksdescription(exotriter);
M_.det_shocks = [ M_.det_shocks;struct('exo_det',0,'exo_id',(currenttrshock{1}.shockindex+1),'multiplicative',0,'periods',currenttrshock{1}.shockstartperiod:currenttrshock{1}.shockendperiod,'value',currenttrshock{1}.shockvalue) ];
if isfield(jm, 'transitory_shocks') && ~isempty(jm.transitory_shocks)
for i = 1:length(jm.transitory_shocks)
s = jm.transitory_shocks(i);
M_.det_shocks = [ ...
M_.det_shocks; ...
struct('exo_det', 0, ...
'exo_id', s.index, ...
'multiplicative', 0, ...
'periods', s.start_period:s.end_period, ...
'value', s.value)];
end
M_.exo_det_length = 0;
end