diff scripts/general/num2str.m @ 5947:009fa69b6182

[project @ 2006-08-21 16:15:20 by jwe]
author jwe
date Mon, 21 Aug 2006 16:15:20 +0000
parents 2e86e3601e0f
children 69e864d21c11
line wrap: on
line diff
--- a/scripts/general/num2str.m
+++ b/scripts/general/num2str.m
@@ -32,15 +32,14 @@
 function retval = num2str (x, arg)
 
   if (nargin != 1 && nargin != 2)
-    usage ("num2str (x) or num2str (x, precision) or num2str (x, fmt)");
+    print_usage ();
   endif
 
   if (ischar (x))
     retval = x;
-    return;
-  endif
-
-  if (iscomplex (x))
+  elseif (isempty (x))
+    retval = "";
+  elseif (iscomplex (x))
     if (nargin == 2)
       if (ischar (arg))
 	fmt = strcat (arg, "%-+", arg(2:end), "i");