Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > List Manipulation > Rearranging & Restructuring Lists >
Mathematica > Data Manipulation > Handling Arrays of Data > Rearranging & Restructuring Lists >

RotateRight

RotateRight[expr, n]
cycles the elements in expr n positions to the right.
RotateRight[expr]
cycles one position to the right.
RotateRight[expr, {n1, n2, ...}]
cycles elements at successive levels n_(i) positions to the right.
  • RotateRight[expr, -n] rotates n positions to the left.
Rotate two positions to the right:
Rotate one position to the right:
Rotate two positions to the right:
In[1]:=
Click for copyable input
Out[1]=
 
Rotate one position to the right:
In[1]:=
Click for copyable input
Out[1]=
Rotate one position right at the first level, and left at the second level:
Rotate an expression with any head:
Successively rotate a list right:
Rotate successive rows of a matrix by their row number:
Rotate a 2D image:
Rotate operands:
New in 1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team