comparison scripts/signal/fftshift.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 cadc73247d65
comparison
equal deleted inserted replaced
7207:71c03c7239fb 7208:a730e47fda4d
58 nd = ndims (V); 58 nd = ndims (V);
59 sz = size (V); 59 sz = size (V);
60 sz2 = ceil (sz(dim) / 2); 60 sz2 = ceil (sz(dim) / 2);
61 idx = cell (); 61 idx = cell ();
62 for i=1:nd 62 for i=1:nd
63 idx {i} = 1:sz(i); 63 idx{i} = 1:sz(i);
64 endfor 64 endfor
65 idx {dim} = [sz2+1:sz(dim), 1:sz2]; 65 idx{dim} = [sz2+1:sz(dim), 1:sz2];
66 retval = V (idx{:}); 66 retval = V (idx{:});
67 else 67 else
68 if (isvector (V)) 68 if (isvector (V))
69 x = length (V); 69 x = length (V);
70 xx = ceil (x/2); 70 xx = ceil (x/2);