Mathematica 9 is now available
 Documentation / Mathematica / Built-in Functions / Lists and Matrices / List Operations  /
RotateRight

  • RotateRight[ expr , n ] cycles the elements in expr n positions to the right.
  • RotateRight[ expr ] cycles one position to the right.
  • RotateRight[ expr , , , ... ] cycles elements at successive levels positions to the right.
  • Example: RotateRight[ a, b, c , 1].
  • RotateRight[ expr , - n ] rotates n positions to the left.
  • See the Mathematica book: Section 1.8.9.
  • See also: Reverse.

    Further Examples

    This rotates each element one place to the right.

    In[1]:=

    Out[1]=

    This rotates each element two places to the right.

    In[2]:=

    Out[2]=

    This rotates each element one place to the left.

    In[3]:=

    Out[3]=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.