diff --git a/matlab/check_posterior_analysis_data.m b/matlab/check_posterior_analysis_data.m index d474bdaf7..f54394442 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 pddate1 diff --git a/matlab/selec_posterior_draws.m b/matlab/selec_posterior_draws.m index 8749fdd7c..0c3c9cadc 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);