diff --git a/matlab/dynare_solve.m b/matlab/dynare_solve.m
index 3e323b2c925744c29c2fa56b4bb217ad0b03105a..21513dc0a0ffdd206460df95a9e9436bd863ca3f 100644
--- a/matlab/dynare_solve.m
+++ b/matlab/dynare_solve.m
@@ -317,13 +317,12 @@ elseif ismember(options.solve_algo, [2, 12, 4])
             [fval_check, fjac] = feval(f, x, args{:});
             if norm(fval_check(j1(j))) < tolf
                 errorflag = false;
-                errorcode = 0;
                 continue
             end
         end
         if blockcolumns>=blocklength
             %(under-)determined block
-            [x, errorflag, errorcode] = solver(f, x, j1(j), j2(j), jacobian_flag, ...
+            [x, errorflag] = solver(f, x, j1(j), j2(j), jacobian_flag, ...
                 options.gstep, ...
                 tolf, options.solve_tolx, maxit, ...
                 options.debug, args{:});
@@ -332,7 +331,6 @@ elseif ismember(options.solve_algo, [2, 12, 4])
             fprintf('\nDYNARE_SOLVE (solve_algo=2|4|12): the Dulmage-Mendelsohn decomposition returned a non-square block. This means that the Jacobian is singular. You may want to try another value for solve_algo.\n')
             %overdetermined block
             errorflag = true;
-            errorcode = 0;
         end
         if errorflag
             return