| MATLAB Function Reference | Search  Help Desk |
| rot90 | Examples See Also |
B = rot90(A) B = rot90(A,k)
B = rot90(A)
rotates matrix A counterclockwise by 90 degrees.
B = rot90(A,k)
rotates matrix A counterclockwise by k*90 degrees, where k is an integer.
The matrix
X =
1 2 3
4 5 6
7 8 9
rotated by 90 degrees is
Y = rot90(X)
Y =
3 6 9
2 5 8
1 4 7
flipdim Flip array along a specified dimension
fliplr Flip matrices left-right
flipud Flip matrices up-down