diff scripts/deprecated/spdiag.m @ 8911:eeed8d649811

spdiag.m: ensure sparse result
author John W. Eaton <jwe@octave.org>
date Thu, 05 Mar 2009 02:56:37 -0500
parents 8dee145c777d
children eb63fbe60fab
line wrap: on
line diff
--- a/scripts/deprecated/spdiag.m	Thu Mar 05 08:34:52 2009 +0100
+++ b/scripts/deprecated/spdiag.m	Thu Mar 05 02:56:37 2009 -0500
@@ -18,7 +18,7 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} spdiag (@var{v}, @var{k})
-## This function has been deprecated.  Use @code{diag} instead.
+## This function has been deprecated.  Use @code{sparse (diag (...))} instead.
 ## @end deftypefn
 
 ## Deprecated in version 3.2
@@ -28,9 +28,9 @@
   if (! warned)
     warned = true;
     warning ("Octave:deprecated-function",
-	     "spdiag is obsolete and will be removed from a future version of Octave; please use diag instead");
+	     "spdiag is obsolete and will be removed from a future version of Octave; please use sparse (diag (...)) instead");
   endif
 
-  retval = diag (varargin{:});
+  retval = sparse (diag (varargin{:}));
 
 endfunction