Mercurial > hg > octave-lyh
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 +++ b/scripts/general/ind2sub.m @@ -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;