diff scripts/signal/fftshift.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 b3c158b8941c
children 571557ddabb9
line wrap: on
line diff
--- a/scripts/signal/fftshift.m
+++ b/scripts/signal/fftshift.m
@@ -58,9 +58,7 @@
     sz = size (x);
     sz2 = ceil (sz(dim) / 2);
     idx = cell ();
-    for i = 1:nd
-      idx{i} = 1:sz(i);
-    endfor
+    idx = repmat ({':'}, nd, 1);
     idx{dim} = [sz2+1:sz(dim), 1:sz2];
     retval = x(idx{:});
   else