diff scripts/general/ind2sub.m @ 6050:435294ca4ee6

[project @ 2006-10-13 17:42:21 by jwe]
author jwe
date Fri, 13 Oct 2006 17:42:21 +0000
parents 34f96dd5441b
children 1b8daf8c0397
line wrap: on
line diff
--- a/scripts/general/ind2sub.m	Fri Oct 13 14:32:23 2006 +0000
+++ b/scripts/general/ind2sub.m	Fri Oct 13 17:42:21 2006 +0000
@@ -29,10 +29,10 @@
 function varargout = ind2sub (dims, ind)
 
   if (nargin == 2)
-    if (isvector (dims) && round (dims) == dims)
-      if (isnumeric (ind) && round (ind) == ind)
+    if (isvector (dims) && all (round (dims) == dims))
+      if (isnumeric (ind) && all (round (ind) == ind))
 	ntot = prod (dims);
-	if (ind > 0 & ind <= ntot)
+	if (all (ind > 0 & ind <= ntot))
 	  nd = length (dims);
 	  if (nargout > 0)
 	    vlen = nargout;