diff --git a/matlab/plot_shock_decomposition.m b/matlab/plot_shock_decomposition.m
index dbe76f9b95dfd5255ff80e93f2cf7038f4b5ca87..a601e8b189e91a287793aca46b41d5f76dd8ebcd 100644
--- a/matlab/plot_shock_decomposition.m
+++ b/matlab/plot_shock_decomposition.m
@@ -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