Commit 79bdde79 authored by Marco Ratto's avatar Marco Ratto

implement new options flip and diff for plotting decompositions

parent 21841958
......@@ -46,6 +46,16 @@ endo_nbr = M_.endo_nbr;
nshocks = M_.exo_nbr;
fig_name='';
if isfield(options_.plot_shock_decomp,'diff') % private trap for uimenu calls
differentiate_decomp=options_.plot_shock_decomp.diff;
else
differentiate_decomp=0;
end
if isfield(options_.plot_shock_decomp,'flip') % private trap for uimenu calls
flip_decomp=options_.plot_shock_decomp.flip;
else
flip_decomp=0;
end
if isfield(options_.plot_shock_decomp,'expand') % private trap for uimenu calls
expand=options_.plot_shock_decomp.expand;
else
......@@ -229,6 +239,12 @@ if isempty(options_.plot_shock_decomp.colormap)
options_.plot_shock_decomp.colormap = MAP;
end
if differentiate_decomp
z(:,:,2:end) = z(:,:,2:end)-z(:,:,1:end-1);
z(:,:,1) = nan;
steady_state = steady_state*0;
end
switch type
case '' % default
......@@ -337,6 +353,11 @@ switch type
error('plot_shock_decomposition:: Wrong type')
end
if flip_decomp
z = -z;
steady_state = - steady_state;
end
if steadystate
options_.plot_shock_decomp.steady_state=steady_state;
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