diff scripts/sparse/spdiags.m @ 7515:f3c00dc0912b

Eliminate the rest of the dispatched sparse functions
author David Bateman <dbateman@free.fr>
date Fri, 22 Feb 2008 15:50:51 +0100
parents f5005d9510f4
children b93ac0586e4b
line wrap: on
line diff
--- a/scripts/sparse/spdiags.m
+++ b/scripts/sparse/spdiags.m
@@ -21,7 +21,7 @@
 ## @deftypefnx {Function File} {@var{b} =} spdiags (@var{a}, @var{c})
 ## @deftypefnx {Function File} {@var{b} =} spdiags (@var{v}, @var{c}, @var{a})
 ## @deftypefnx {Function File} {@var{b} =} spdiags (@var{v}, @var{c}, @var{m}, @var{n})
-## A generalization of the function @code{spdiag}. Called with a single
+## A generalization of the function @code{diag}. Called with a single
 ## input argument, the non-zero diagonals @var{c} of @var{A} are extracted.
 ## With two arguments the diagonals to extract are given by the vector 
 ## @var{c}.
@@ -56,8 +56,8 @@
 
   if (nargin == 1 || nargin == 2)
     ## extract nonzero diagonals of v into A,c
+    [nr, nc] = size (v);
     [i, j, v] = find (v);
-    [nr, nc] = size (v);
 
     if (nargin == 1)
       ## c contains the active diagonals