From b9e0017b61cd66541f4a243aa1c2edcca7aefef1 Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@jrc.ec.europa.eu>
Date: Tue, 14 Apr 2015 12:10:46 +0200
Subject: [PATCH] Bug fixed for incomplete stock matrices of log-posterior
 kernel and steady state [used in gsa/filt_mc_.m]

(cherry picked from commit a44b3fbfe7c0214c19f6eecabe368c2e72c9346f)
---
 matlab/prior_posterior_statistics_core.m | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/matlab/prior_posterior_statistics_core.m b/matlab/prior_posterior_statistics_core.m
index f7eaa6f28e..8d779097be 100644
--- a/matlab/prior_posterior_statistics_core.m
+++ b/matlab/prior_posterior_statistics_core.m
@@ -277,6 +277,8 @@ for b=fpar:B
 
     if irun(5) > MAX_nruns || b == B
         stock = stock_param(1:irun(5)-1,:);
+        stock_logpo = stock_logpo(1:irun(5)-1);
+        stock_ys = stock_ys(1:irun(5)-1,:);
         ifil(5) = ifil(5) + 1;
         save([DirectoryName '/' M_.fname '_param' int2str(ifil(5)) '.mat'],'stock','stock_logpo','stock_ys');
         if RemoteFlag==1,
-- 
GitLab