FUNCTION REFERENCE

rot90

Rotate an array by multiples of 90 degrees.

Rotate an array by multiples of 90 degrees.

Syntax

B = rot90(A)

Syntax

B = rot90(A, k)

Rotates counterclockwise by k*90 degrees; k is any integer, negative k turns clockwise.

Numeric, logical, complex, character and cell input. k must be a scalar integer.

Example

rot90([1 2; 3 4])   % [2 4; 1 3]

Differences from MATLAB: N-dimensional input is not supported. Integer and single values retain their storage class.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.