From 3d45b7632f4d30a03650c7faba6c6b2f7f66206b Mon Sep 17 00:00:00 2001
From: Marco Ratto <marco.ratto@jrc.ec.europa.eu>
Date: Fri, 12 Feb 2010 19:31:39 +0100
Subject: [PATCH] bug fixes for use with octave for windows (cherry picked,
 with manual merge, from commit be510a4b930b27d0c23ed888659cc65d003c0f03)

---
 matlab/PosteriorIRF.m | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/matlab/PosteriorIRF.m b/matlab/PosteriorIRF.m
index c9e75fe136..fcabcbbfd6 100644
--- a/matlab/PosteriorIRF.m
+++ b/matlab/PosteriorIRF.m
@@ -78,11 +78,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);
@@ -93,10 +93,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;
@@ -295,10 +295,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);
 
 
@@ -321,7 +321,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)
@@ -359,7 +359,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)
@@ -389,7 +389,7 @@ end
 %%      Finally I build the plots.
 %%
 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');
-- 
GitLab