From 0123d84b76012996c33327e435802aec3ecb690c Mon Sep 17 00:00:00 2001
From: Michel Juillard <michel.juillard@mjui.fr>
Date: Mon, 10 Dec 2012 21:14:00 +0100
Subject: [PATCH] fixed bug in conditional forecasts whith constraints on only
 one period (cherry picked from commit
 bcb59e373de4c4a488b2fc3f947bace7b60acab3)

---
 matlab/imcforecast.m | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/matlab/imcforecast.m b/matlab/imcforecast.m
index 51d4c19de..3a60857aa 100644
--- a/matlab/imcforecast.m
+++ b/matlab/imcforecast.m
@@ -171,11 +171,8 @@ for i=1:n1
     mu(jdx(i),i) = 1;
 end
 
-if (size(constrained_paths,2) == 1);
-    constrained_paths = constrained_paths*ones(1,cL);
-else
-    cL = size(constrained_paths,2);
-end
+% number of periods with constrained values
+cL = size(constrained_paths,2);
 
 constrained_paths = bsxfun(@minus,constrained_paths,trend(idx,1:cL));
 
-- 
GitLab