% -*- texinfo -*- % @deftypefn {Function File} {@var{y} =} circshift (@var{x}, @var{n}) % Circularly shifts the values of the array @var{x}. @var{n} must be % a vector of integers no longer than the number of dimensions in % @var{x}. The values of @var{n} can be either positive or negative, % which determines the direction in which the values or @var{x} are % shifted. If an element of @var{n} is zero, then the corresponding % dimension of @var{x} will not be shifted. For example % % @example % @group % x = [1, 2, 3; 4, 5, 6; 7, 8, 9]; % circshift (x, 1) % @result{} 7, 8, 9 % 1, 2, 3 % 4, 5, 6 % circshift (x, -2) % @result{} 7, 8, 9 % 1, 2, 3 % 4, 5, 6 % circshift (x, [0,1]) % @result{} 3, 1, 2 % 6, 4, 5 % 9, 7, 8 % @end group % @end example % @seealso {permute, ipermute, shiftdim} % @end deftypefn