Mercurial > hg > octave-lyh
diff scripts/sparse/spdiags.m @ 6524:03c89ade4070
[project @ 2007-04-13 12:19:30 by jwe]
author | jwe |
---|---|
date | Fri, 13 Apr 2007 12:22:12 +0000 |
parents | 2c85044aa63f |
children | 4fb053f24fd6 |
line wrap: on
line diff
--- a/scripts/sparse/spdiags.m +++ b/scripts/sparse/spdiags.m @@ -76,7 +76,7 @@ ## Create new matrix of size mxn using v,c [j, i, v] = find (v); offset = max (min (c(:), n-m), 0); - j += offset(i); + j = j(:) + offset(i); i = j-c(:)(i); idx = i > 0 & i <= m & j > 0 & j <= n; A = sparse (i(idx), j(idx), v(idx), m, n);