diff --git a/src/dassert.m b/src/dassert.m
index e958a65be161432a24af9beba776dffae7de8292..43950564288b9ca4517f63e05c544d7e35dff1c9 100644
--- a/src/dassert.m
+++ b/src/dassert.m
@@ -52,7 +52,11 @@ if isa(A,'double')
     if use_isequal_matlab_builtin
         t = isequal(A,B);
         if ~t
-            t = isequalwithequalnans(A,B);
+            if ~isoctave && matlab_ver_less_than('7.14')
+                t = isequalwithequalnans(A,B);
+            else
+                t = isequaln(A,B);
+            end
         end
     else
         if max(abs(A(:)-B(:)))>tol