From be510a4b930b27d0c23ed888659cc65d003c0f03 Mon Sep 17 00:00:00 2001 From: Marco Ratto Date: Fri, 12 Feb 2010 19:31:39 +0100 Subject: [PATCH] bug fixes for use with octave for windows --- matlab/PosteriorIRF.m | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/matlab/PosteriorIRF.m b/matlab/PosteriorIRF.m index 5877d2efd..47548110d 100644 --- a/matlab/PosteriorIRF.m +++ b/matlab/PosteriorIRF.m @@ -79,11 +79,11 @@ else MhDirectoryName = CheckPath('prior'); end if strcmpi(type,'posterior') - load([ MhDirectoryName '/' M_.fname '_mh_history.mat']) + load([ MhDirectoryName filesep M_.fname '_mh_history.mat']) TotalNumberOfMhDraws = sum(record.MhDraws(:,1)); NumberOfDraws = TotalNumberOfMhDraws-floor(options_.mh_drop*TotalNumberOfMhDraws); elseif strcmpi(type,'gsa') - load([ MhDirectoryName '/' M_.fname '_prior.mat'],'lpmat0','lpmat','istable') + load([ MhDirectoryName filesep M_.fname '_prior.mat'],'lpmat0','lpmat','istable') x=[lpmat0(istable,:) lpmat(istable,:)]; clear lpmat istable NumberOfDraws=size(x,1); @@ -94,10 +94,10 @@ end if ~strcmpi(type,'gsa') B = min([round(.5*NumberOfDraws),500]); options_.B = B; end -try delete([MhDirectoryName '/' M_.fname '_irf_dsge*.mat']) +try delete([MhDirectoryName filesep M_.fname '_irf_dsge*.mat']) catch disp('No _IRFs (dsge) files to be deleted!') end -try delete([MhDirectoryName '/' M_.fname '_irf_bvardsge*.mat']) +try delete([MhDirectoryName filesep M_.fname '_irf_bvardsge*.mat']) catch disp('No _IRFs (bvar-dsge) files to be deleted!') end irun = 0; @@ -239,10 +239,10 @@ if strcmpi(type,'gsa') return end -IRF_DSGEs = dir([MhDirectoryName '/' M_.fname '_IRF_DSGEs*.mat']); +IRF_DSGEs = dir([MhDirectoryName filesep M_.fname '_IRF_DSGEs*.mat']); NumberOfIRFfiles_dsge = length(IRF_DSGEs); -IRF_BVARDSGEs = dir([MhDirectoryName '/' M_.fname '_IRF_BVARDSGEs*.mat']); +IRF_BVARDSGEs = dir([MhDirectoryName filesep M_.fname '_IRF_BVARDSGEs*.mat']); NumberOfIRFfiles_dsgevar = length(IRF_BVARDSGEs); @@ -265,7 +265,7 @@ tit(M_.exo_names_orig_ord,:) = M_.exo_names; kdx = 0; for file = 1:NumberOfIRFfiles_dsge - load([MhDirectoryName '/' M_.fname '_IRF_DSGEs' int2str(file) '.mat']); + load([MhDirectoryName filesep M_.fname '_IRF_DSGEs' int2str(file) '.mat']); for i = 1:M_.exo_nbr for j = 1:nvar for k = 1:size(STOCK_IRF_DSGE,1) @@ -304,7 +304,7 @@ if MAX_nirfs_dsgevar tit(M_.exo_names_orig_ord,:) = M_.exo_names; kdx = 0; for file = 1:NumberOfIRFfiles_dsgevar - load([MhDirectoryName '/' M_.fname '_IRF_BVARDSGEs' int2str(file) '.mat']); + load([MhDirectoryName filesep M_.fname '_IRF_BVARDSGEs' int2str(file) '.mat']); for i = 1:M_.exo_nbr for j = 1:nvar for k = 1:size(STOCK_IRF_BVARDSGE,1) @@ -363,7 +363,7 @@ localVars.MaxNumberOfPlotPerFigure=MaxNumberOfPlotPerFigure; %%% The files .TeX are genereted in sequential way! if options_.TeX - fidTeX = fopen([DirectoryName '/' M_.fname '_BayesianIRF.TeX'],'w'); + fidTeX = fopen([DirectoryName filesep M_.fname '_BayesianIRF.TeX'],'w'); fprintf(fidTeX,'%% TeX eps-loader file generated by PosteriorIRF.m (Dynare).\n'); fprintf(fidTeX,['%% ' datestr(now,0) '\n']); fprintf(fidTeX,' \n');