Main Content

Shift array circularly

`Y = circshift(`

circularly
shifts the elements in array `A`

,`K`

)`A`

by `K`

positions.
If `K`

is an integer, then `circshift`

shifts
along the first dimension of `A`

whose size does
not equal 1. If `K`

is a vector of integers, then
each element of `K`

indicates the shift amount in
the corresponding dimension of `A`

.

**Note**

The default behavior of `circshift(A,K)`

where `K`

is
a scalar changed in R2016b. To preserve the behavior of R2016a and
previous releases, use `circshift(A,K,1)`

. This syntax
specifies 1 as the dimension to operate along.