%% Shift Vector Elements
% Swap the left and right halves of a row vector. If a vector has an odd number of elements, then the middle element is considered part of the left half of the vector.

Xeven = [1 2 3 4 5 6];
fftshift(Xeven)

%

Xodd = [1 2 3 4 5 6 7];
fftshift(Xodd)

% Copyright 2012 The MathWorks, Inc.