diff --git a/matlab/check_posterior_analysis_data.m b/matlab/check_posterior_analysis_data.m index d474bdaf779e5fe2269d02051bb213a5e1be6304..f5439444223717a5f44619b464d4cb0173bf6881 100644 --- a/matlab/check_posterior_analysis_data.m +++ b/matlab/check_posterior_analysis_data.m @@ -31,14 +31,17 @@ function [info,description] = check_posterior_analysis_data(type,M_) mhdate = get_date_of_a_file(mhname); %% Get informations about _posterior_draws files. - if ~exist([ M_.dname '/metropolis/' M_.fname '_posterior_draws.mat']) + drawsinfo = dir([ M_.dname '/metropolis/' M_.fname '_posterior_draws*.mat']); + if isempty(drawsinfo) info = 1; % select_posterior_draws has to be called first. if nargout>1 description = 'select_posterior_draws has to be called.'; end return else - pddate = get_date_of_a_file([ M_.dname '/metropolis/' M_.fname '_posterior_draws.mat']); + number_of_last_posterior_draws_file = length(drawsinfo); + pddate = get_date_of_a_file([ M_.dname '/metropolis/' M_.fname '_posterior_draws'... + int2str(number_of_last_posterior_draws_file) '.mat']); if pddate<mhdate info = 2; % _posterior_draws files have to be updated. if nargout>1 diff --git a/matlab/selec_posterior_draws.m b/matlab/selec_posterior_draws.m index 8749fdd7cc9206a3f81e0142b3b60d4ec28830e2..0c3c9cadc433e7dee64e2062eacc338cbdd1ca3b 100644 --- a/matlab/selec_posterior_draws.m +++ b/matlab/selec_posterior_draws.m @@ -118,7 +118,7 @@ function SampleAddress = selec_posterior_draws(SampleSize,drsize) old_mhblck = mhblck; end clear('x2') - save([fname '_posterior_draws'],'pdraws') + save([fname '_posterior_draws1'],'pdraws') else% The posterior draws are saved in xx files. NumberOfDrawsPerFile = fix(MAX_mega_bytes/drawsize); NumberOfFiles = ceil(SampleSize*drawsize/MAX_mega_bytes);