Learn R Programming

matlab (version 1.0.4.1)

rot90: MATLAB rot90 function

Description

Rotates matrix counterclockwise k*90 degrees.

Usage

rot90(A, k=1)

Value

Returns matrix corresponding to argument A having been rotated argument k number of times.

Arguments

A

matrix to be rotated

k

numeric scalar specifying the number of times to rotate (1..4)

Author

P. Roebuck proebuck1701@gmail.com

Details

Rotating 4 times (360 degrees) returns the original matrix unchanged.

See Also

fliplr, flipud

Examples

Run this code
rot90(matrix(1:4, 2, 2))

Run the code above in your browser using DataLab