We have moved to @ Placement Papers Hub !! Visit our new website here for more..

circshift Matlab Matrix Shifting


4. Matlab Matrix Shifting

 *B = circshift(A, shiftsize) circularly shifts the values in the array, A, by shiftsize elements

>> A=[1 2 3; 4 5 6; 7 8 9]

A =

     1     2     3
     4     5     6
     7     8     9

>> B=circshift(A,1)

B =

     7     8     9
     1     2     3
     4     5     6

>> B=circshift(A,[1,-1])

B =

     8     9     7
     2     3     1
     5     6     4

>> B=circshift(A,[1,1])

B =

     9     7     8
     3     1     2
     6     4     5