Mercurial > octave-nkf
diff scripts/general/prepad.m @ 12676:2783fa95cab7
Use common code idiom for creating cell array for indexing ND-arrays
* int2str.m, interpft.m, num2str.m, postpad.m, prepad.m, shift.m, fftshift.m,
ifftshift.m, unwrap.m
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sun, 15 May 2011 10:50:30 -0700 |
parents | 9493880928c8 |
children | 9e7ebbaf69ff |
line wrap: on
line diff
--- a/scripts/general/prepad.m Sun May 15 08:58:49 2011 -0700 +++ b/scripts/general/prepad.m Sun May 15 10:50:30 2011 -0700 @@ -73,10 +73,7 @@ d = sz (dim); if (d >= l) - idx = cell (); - for i = 1:nd - idx{i} = 1:sz(i); - endfor + idx = repmat ({':'}, nd, 1); idx{dim} = d-l+1:d; y = x(idx{:}); else