diff --git a/m4/ax_matlab_version.m4 b/m4/ax_matlab_version.m4
index 049feb80357ac288381458f190299dfbd7cc3ba5..12b5693dc8b3153588734b2a6fe2d3132e62f2ff 100644
--- a/m4/ax_matlab_version.m4
+++ b/m4/ax_matlab_version.m4
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2009-2012 Dynare Team
+dnl Copyright (C) 2009-2013 Dynare Team
 dnl
 dnl This file is part of Dynare.
 dnl
@@ -22,6 +22,9 @@ AC_REQUIRE([AX_MATLAB])
 AC_MSG_CHECKING([for MATLAB version])
 if test "x$MATLAB_VERSION" != "x"; then
   case $MATLAB_VERSION in
+    *2013a | *2013A)
+      MATLAB_VERSION="8.1"
+      ;;
     *2012b | *2012B)
       MATLAB_VERSION="8.0"
       ;;
diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m
index e89e6f9276a0a002fc1a11d7675e82a48c998b64..57f91611342fc0fb5e6fe66024e0f5ea3379fb38 100644
--- a/matlab/dynare_config.m
+++ b/matlab/dynare_config.m
@@ -15,7 +15,7 @@ function dynareroot = dynare_config(path_to_dynare,verbose)
 % SPECIAL REQUIREMENTS
 %   none
 
-% Copyright (C) 2001-2012 Dynare Team
+% Copyright (C) 2001-2013 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -110,7 +110,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/win32-7.5-8.0'];
+            mexpath = [dynareroot '../mex/matlab/win32-7.5-8.1'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
@@ -135,7 +135,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/win64-7.8-8.0'];
+            mexpath = [dynareroot '../mex/matlab/win64-7.8-8.1'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
@@ -149,7 +149,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/osx32-7.5-8.0'];
+            mexpath = [dynareroot '../mex/matlab/osx32-7.5-8.1'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
diff --git a/osx/createOsxFolderForPkg.sh b/osx/createOsxFolderForPkg.sh
index da91860aff1ad0af05efd0f1dfe68099c667fbb5..feefa8de7d5936e43cfa55157191c72797ba0cdf 100755
--- a/osx/createOsxFolderForPkg.sh
+++ b/osx/createOsxFolderForPkg.sh
@@ -29,7 +29,7 @@ mkdir -p "$INSTALLDIR/contrib/ms-sbvar/TZcode"
 mkdir -p "$INSTALLDIR/mex/octave"
 mkdir -p "$INSTALLDIR/mex/matlab/osx64"
 mkdir "$INSTALLDIR/mex/matlab/osx32-7.4"
-mkdir "$INSTALLDIR/mex/matlab/osx32-7.5-8.0"
+mkdir "$INSTALLDIR/mex/matlab/osx32-7.5-8.1"
 
 
 # top level
@@ -122,17 +122,17 @@ cd $TOP_DYN_DIR/mex/build/matlab
 make
 
 # Matlab
-cp $TOP_DYN_DIR/mex/build/matlab/block_kalman_filter/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/bytecode/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/dynare_simul_/*.mexmaci                            $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/gensylv/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/k_order_perturbation/*.mexmaci                     $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/kalman_steady_state/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/kronecker/*.mexmaci                                $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/local_state_space_iterations/*.mexmaci             $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/mjdgges/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/ms_sbvar/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.0
-cp $TOP_DYN_DIR/mex/build/matlab/sobol/*.mexmaci                                    $INSTALLDIR/mex/matlab/osx32-7.5-8.0
+cp $TOP_DYN_DIR/mex/build/matlab/block_kalman_filter/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/bytecode/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/dynare_simul_/*.mexmaci                            $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/gensylv/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/k_order_perturbation/*.mexmaci                     $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/kalman_steady_state/*.mexmaci                      $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/kronecker/*.mexmaci                                $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/local_state_space_iterations/*.mexmaci             $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/mjdgges/*.mexmaci                                  $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/ms_sbvar/*.mexmaci                                 $INSTALLDIR/mex/matlab/osx32-7.5-8.1
+cp $TOP_DYN_DIR/mex/build/matlab/sobol/*.mexmaci                                    $INSTALLDIR/mex/matlab/osx32-7.5-8.1
 
 
 #####################################
diff --git a/windows/dynare.nsi b/windows/dynare.nsi
index 6ec57ee026638527c23d72e6147cf4dce8526594..7a32ad55564630325dfaf5cc25564fe13d823d96 100644
--- a/windows/dynare.nsi
+++ b/windows/dynare.nsi
@@ -93,9 +93,9 @@ Section "MEX files for MATLAB 32-bit, version 7.3 to 7.4 (R2006b to R2007a)"
  File ..\mex\matlab\win32-7.3-7.4\*.mexw32
 SectionEnd
 
-Section "MEX files for MATLAB 32-bit, version 7.5 to 8.0 (R2007b to R2012b)"
- SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.0
- File ..\mex\matlab\win32-7.5-8.0\*.mexw32
+Section "MEX files for MATLAB 32-bit, version 7.5 to 8.1 (R2007b to R2013a)"
+ SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.1
+ File ..\mex\matlab\win32-7.5-8.1\*.mexw32
 SectionEnd
 
 Section "MEX files for MATLAB 64-bit, version 7.2 (R2006a)"
@@ -113,9 +113,9 @@ Section "MEX files for MATLAB 64-bit, version 7.5 to 7.7 (R2007b to R2008b)"
  File ..\mex\matlab\win64-7.5-7.7\*.mexw64
 SectionEnd
 
-Section "MEX files for MATLAB 64-bit, version 7.8 to 8.0 (R2009a to R2012b)"
- SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.0
- File ..\mex\matlab\win64-7.8-8.0\*.mexw64
+Section "MEX files for MATLAB 64-bit, version 7.8 to 8.1 (R2009a to R2013a)"
+ SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.1
+ File ..\mex\matlab\win64-7.8-8.1\*.mexw64
 SectionEnd
 
 SectionGroupEnd