diff --git a/matlab/+bvar/forecast.m b/matlab/+bvar/forecast.m
index 2ca24f4ddb6342bd4e14f2981480ba8670576b27..6fb0d2ca9d4d26ffc54e8b3e1075564bb5c04903 100644
--- a/matlab/+bvar/forecast.m
+++ b/matlab/+bvar/forecast.m
@@ -154,8 +154,8 @@ end
 % Store results
 
 DirectoryName = [ M_.dname '/bvar_forecast' ];
-if ~isdir(DirectoryName)
-    if ~isdir(M_.dname)
+if ~isfolder(DirectoryName)
+    if ~isfolder(M_.dname)
         mkdir(M_.dname);
     end
     mkdir(DirectoryName);
diff --git a/matlab/+bvar/irf.m b/matlab/+bvar/irf.m
index 3889989059c68d65a935b8c7d950d71390c9d260..69074e2cceabc39d9a0e09b601584ce602b80168 100644
--- a/matlab/+bvar/irf.m
+++ b/matlab/+bvar/irf.m
@@ -130,7 +130,7 @@ end
 
 % Save intermediate results
 DirectoryName = [ M_.dname '/bvar_irf' ];
-if ~isdir(DirectoryName)
+if ~isfolder(DirectoryName)
     mkdir('.',DirectoryName);
 end
 save([ DirectoryName '/simulations.mat'], 'sampled_irfs');
@@ -146,4 +146,4 @@ for i=1:ny
         oo_.bvar.irf.Upper_bound.(variable_name).(shock_name) = posterior_up_conf_irfs(j,i,:);
         oo_.bvar.irf.Lower_bound.(variable_name).(shock_name) = posterior_down_conf_irfs(j,i,:);
     end
-end
\ No newline at end of file
+end
diff --git a/matlab/CheckPath.m b/matlab/CheckPath.m
index 6f27753c48d393420f7e443809d1ea78007ab12e..d7e85b4c17b79b4bd0b9dd770d14dd70d56638fe 100644
--- a/matlab/CheckPath.m
+++ b/matlab/CheckPath.m
@@ -33,7 +33,7 @@ info = 0;
 
 DirectoryName = [ dname '/' type ]; % don't use filesep as it will create issues with LaTeX on Windows
 
-if ~isdir(dname)
+if ~isfolder(dname)
     % Make sure there isn't a file with the same name, see trac ticket #47
     if isfile(dname)
         delete(dname)
@@ -41,7 +41,7 @@ if ~isdir(dname)
     mkdir('.', dname);
 end
 
-if ~isdir(DirectoryName)
+if ~isfolder(DirectoryName)
     % Make sure there isn't a file with the same name, see trac ticket #47
     if isfile(DirectoryName)
         delete(DirectoryName)