diff scripts/general/logical.m @ 3674:ef883684e58e

[project @ 2000-06-07 17:11:33 by jwe]
author jwe
date Wed, 07 Jun 2000 17:11:34 +0000
parents 858695b3ed62
children 4c8a2e4e0717
line wrap: on
line diff
--- a/scripts/general/logical.m	Mon Jun 05 18:28:54 2000 +0000
+++ b/scripts/general/logical.m	Wed Jun 07 17:11:34 2000 +0000
@@ -38,10 +38,12 @@
 function y = logical (x)
 
   if (nargin == 1)
-    if (! islogical (x))
+    if (islogical (x) || isempty (x))
+      y = x;
+    elseif (isnumeric (x))
       y = x != 0;
     else
-      y = x;
+      error ("logical not defined for type `%s'", typeinfo (x));
     endif
   else
     usage ("logical (x)");