Mercurial > hg > octave-lyh
diff scripts/general/num2str.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 | c792872f8942 |
children | 984359717d71 |
line wrap: on
line diff
--- a/scripts/general/num2str.m +++ b/scripts/general/num2str.m @@ -111,10 +111,7 @@ nd = ndims (x); perm = fix ([1:0.5:nc+0.5]); perm(2:2:2*nc) = perm(2:2:2*nc) + nc; - idx = cell (); - for i = 1:nd - idx{i} = 1:sz(i); - endfor + idx = repmat ({':'}, nd, 1); idx{2} = perm; x = horzcat (real (x), imag (x)); x = x(idx{:});