From 86e646488c260ba46941706a716ba19cdcdb8cdc Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Fri, 15 Sep 2017 18:41:41 +0200 Subject: [PATCH] mode_check.m: fix case where parameter is exactly 0 In this case, interval length was 0, crashing the plotting --- matlab/mode_check.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/matlab/mode_check.m b/matlab/mode_check.m index 2df26ff0c..3131f10cc 100644 --- a/matlab/mode_check.m +++ b/matlab/mode_check.m @@ -111,8 +111,15 @@ for plt = 1:nbplt end end xx = x; - l1 = max(BoundsInfo.lb(kk),(1-sign(x(kk))*ll)*x(kk)); m1 = 0; %lower bound - l2 = min(BoundsInfo.ub(kk),(1+sign(x(kk))*ll)*x(kk)); %upper bound + if x(kk)~=0 + l1 = max(BoundsInfo.lb(kk),(1-sign(x(kk))*ll)*x(kk)); m1 = 0; %lower bound + l2 = min(BoundsInfo.ub(kk),(1+sign(x(kk))*ll)*x(kk)); %upper bound + else + %size info for 0 parameter is missing, use prior standard + %deviation + l1 = max(BoundsInfo.lb(kk),-BayesInfo.p2(kk)); m1 = 0; %lower bound + l2 = min(BoundsInfo.ub(kk),BayesInfo.p2(kk)); %upper bound + end binding_lower_bound=0; binding_upper_bound=0; if isequal(x(kk),BoundsInfo.lb(kk))