Mercurial > hg > octave-nkf
diff scripts/general/shift.m @ 7208:a730e47fda4d
[project @ 2007-11-28 02:32:41 by jwe]
author | jwe |
---|---|
date | Wed, 28 Nov 2007 02:32:42 +0000 |
parents | a1dbe9d80eee |
children | 83a8781b529d |
line wrap: on
line diff
--- a/scripts/general/shift.m +++ b/scripts/general/shift.m @@ -69,16 +69,16 @@ idx = cell (); for i = 1:nd - idx {i} = 1:sz(i); + idx{i} = 1:sz(i); endfor if (b >= 0) b = rem (b, d); - idx {dim} = [d-b+1:d, 1:d-b]; + idx{dim} = [d-b+1:d, 1:d-b]; elseif (b < 0) b = rem (abs (b), d); - idx {dim} = [b+1:d, 1:b]; + idx{dim} = [b+1:d, 1:b]; endif - y = x (idx {:}); + y = x(idx{:}); endfunction