From cac48d2e8099d1e516cfc0753d49ea4b9cd0420c Mon Sep 17 00:00:00 2001 From: Johannes Pfeifer Date: Fri, 13 Dec 2013 18:29:48 +0100 Subject: [PATCH] Initialize stock1_filter_step_ahead to prevent crash in Octave --- matlab/pm3.m | 3 +++ 1 file changed, 3 insertions(+) diff --git a/matlab/pm3.m b/matlab/pm3.m index 567ba71da..9e34bf1c0 100644 --- a/matlab/pm3.m +++ b/matlab/pm3.m @@ -66,6 +66,9 @@ filter_step_ahead_indicator=0; for file = 1:ifil load([DirectoryName '/' M_.fname var_type int2str(file)]); if size(size(stock),2) == 4 + if file==1 %on first run, initialize variable for storing filter_step_ahead + stock1_filter_step_ahead=NaN(n1,n2,B,length(options_.filter_step_ahead)); + end filter_step_ahead_indicator=1; stock_filter_step_ahead=zeros(n1,n2,size(stock,4),length(options_.filter_step_ahead)); for ii=1:length(options_.filter_step_ahead)