From cc70913b7d72ade864c8641cbc058ee74e07f258 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Tue, 12 Oct 2010 08:07:57 +0200 Subject: [PATCH] Properly close waitbar in serial computations. --- matlab/prior_posterior_statistics.m | 11 ----------- matlab/prior_posterior_statistics_core.m | 20 +++++++++++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/matlab/prior_posterior_statistics.m b/matlab/prior_posterior_statistics.m index 4c1a6f92d..85f18fccb 100644 --- a/matlab/prior_posterior_statistics.m +++ b/matlab/prior_posterior_statistics.m @@ -236,17 +236,6 @@ end ifil = fout(end).ifil; - -if exist('OCTAVE_VERSION') - printf('\n'); - diary on; -else - if exist('h') - close(h) - end - -end - stock_gend=gend; stock_data=Y; save([DirectoryName '/' M_.fname '_data.mat'],'stock_gend','stock_data'); diff --git a/matlab/prior_posterior_statistics_core.m b/matlab/prior_posterior_statistics_core.m index 7f48b9461..c1ac11a0d 100644 --- a/matlab/prior_posterior_statistics_core.m +++ b/matlab/prior_posterior_statistics_core.m @@ -94,12 +94,12 @@ end DirectoryName = CheckPath('metropolis'); RemoteFlag = 0; -for j=1:length(Parallel), - if Parallel(j).Local==0, - RemoteFlag = 1; - end -end if whoiam + for j=1:length(Parallel), + if Parallel(j).Local==0, + RemoteFlag = 1; + end + end ifil=ifil(:,whoiam); waitbarString = ['Please wait... Bayesian (posterior) subdraws (' int2str(fpar) 'of' int2str(B) ')...']; if Parallel(ThisMatlab).Local, @@ -318,3 +318,13 @@ OutputFileName_forc_mean; OutputFileName_forc_point]; % OutputFileName_moments]; end + +if exist('OCTAVE_VERSION') + printf('\n'); + diary on; +else + if exist('h') + close(h) + end + +end