diff --git a/matlab/qz/mjdgges.m b/matlab/qz/mjdgges.m
index 577255af765fb1617a6a6ecab9a06ba98452cd4c..8d188c999ef46e4523eb320d294ec0b8070fdc72 100644
--- a/matlab/qz/mjdgges.m
+++ b/matlab/qz/mjdgges.m
@@ -39,11 +39,8 @@ function [ss,tt,w,sdim,eigval,info] = mjdgges(e,d,qz_criterium)
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
     
 if exist('OCTAVE_VERSION')
-    % Octave can only compute a real QZ with the function qz()
-    % while by default MATLAB computes a complex QZ
-    % Here we need a complex QZ (so that ss and tt are uppeer
-    % triangular), so fail under Octave
-    error('You must compile the MEX file "mjddges", I can''t solve the model without that.')
+    [ss,tt,w,eigval]=qz(e,d,'S');
+    sdim =sum(abs(eigval) < qz_criterium);
 end
 
 % Chek number of inputs and outputs.
@@ -82,4 +79,4 @@ try
     sdim = sum( abs(eigval) < qz_criterium );
 catch
     info = 1;% Not as precise as lapack's info!
-end
\ No newline at end of file
+end