circshift
Shift array circularly
Description
Y = circshift(
circularly shifts the elements in arrayA
,K
)A
byK
positions. IfK
is an integer, thencircshift
shifts along the first dimension ofA
whose size does not equal 1. IfK
is a vector of integers, then each element ofK
indicates the shift amount in the corresponding dimension ofA
.
Note
The default behavior ofcircshift(A,K)
whereK
is a scalar changed in R2016b. To preserve the behavior of R2016a and previous releases, usecircshift(A,K,1)
. This syntax specifies 1 as the dimension to operate along.