diff --git a/m4/ax_matlab_version.m4 b/m4/ax_matlab_version.m4
index 12b5693dc8b3153588734b2a6fe2d3132e62f2ff..55eb57036f3268d98e59cb1605cd3c4e3d10be3a 100644
--- a/m4/ax_matlab_version.m4
+++ b/m4/ax_matlab_version.m4
@@ -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
+    *2013b | *2013B)
+      MATLAB_VERSION="8.2"
+      ;;
     *2013a | *2013A)
       MATLAB_VERSION="8.1"
       ;;
diff --git a/matlab/dynare_config.m b/matlab/dynare_config.m
index 2cd7b74878da842c131de3ab6cdd91243c7d1729..3180a81a6cb741e9da526144e5a0c677463e890c 100644
--- a/matlab/dynare_config.m
+++ b/matlab/dynare_config.m
@@ -118,7 +118,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/win32-7.5-8.1'];
+            mexpath = [dynareroot '../mex/matlab/win32-7.5-8.2'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
@@ -138,7 +138,7 @@ else
                 addpath(mexpath)
             end
         else
-            mexpath = [dynareroot '../mex/matlab/win64-7.8-8.1'];
+            mexpath = [dynareroot '../mex/matlab/win64-7.8-8.2'];
             if exist(mexpath, 'dir')
                 addpath(mexpath)
             end
diff --git a/windows/dynare.nsi b/windows/dynare.nsi
index bd17b0bfe598105e72928bd7489632dcf874b4bb..e2fbc886d336da235c0777122d2204d8158b1c3d 100644
--- a/windows/dynare.nsi
+++ b/windows/dynare.nsi
@@ -88,9 +88,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.1 (R2007b to R2013a)"
- SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.1
- File ..\mex\matlab\win32-7.5-8.1\*.mexw32
+Section "MEX files for MATLAB 32-bit, version 7.5 to 8.2 (R2007b to R2013b)"
+ SetOutPath $INSTDIR\mex\matlab\win32-7.5-8.2
+ File ..\mex\matlab\win32-7.5-8.2\*.mexw32
 SectionEnd
 
 Section "MEX files for MATLAB 64-bit, version 7.3 to 7.4 (R2006b to R2007a)"
@@ -103,9 +103,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.1 (R2009a to R2013a)"
- SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.1
- File ..\mex\matlab\win64-7.8-8.1\*.mexw64
+Section "MEX files for MATLAB 64-bit, version 7.8 to 8.2 (R2009a to R2013b)"
+ SetOutPath $INSTDIR\mex\matlab\win64-7.8-8.2
+ File ..\mex\matlab\win64-7.8-8.2\*.mexw64
 SectionEnd
 
 SectionGroupEnd