CIRCSHIFT Shift array circularly.
B = CIRCSHIFT(A,SHIFTSIZE) circularly shifts the values in the array A
by SHIFTSIZE elements. SHIFTSIZE is a vector of integer scalars (整数标量组成的矢量)where
the N-th element specifies the shift amount for the N-th dimension of
array A. If an element in SHIFTSIZE is positive, the values of A are
shifted down (or to the right). If it is negative, the values of A
are shifted up (or to the left).
Examples:
A = [ 1 2 3;
4 5 6;
7 8 9];
B = circshift(A,1) % circularly shifts first dimension values down by 1.
B = 7 8 9
1 2 3
4 5 6
B = circshift(A,[1 -1]) % circularly shifts first dimension values down by 1 and second dimension left by 1.
B = 8 9 7
2 3 1
5 6 4