rot90: MATLAB rot90 function

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/rot90.R

Description

Rotates matrix counterclockwise k*90 degrees.

Usage

1
rot90(A, k=1)

Arguments

A

matrix to be rotated

k

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

Details

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

Value

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

Author(s)

P. Roebuck [email protected]

See Also

fliplr, flipud

Examples

1
rot90(matrix(1:4, 2, 2))

Example output

Attaching package: 'matlab'

The following object is masked from 'package:stats':

    reshape

The following objects are masked from 'package:utils':

    find, fix

The following object is masked from 'package:base':

    sum

     [,1] [,2]
[1,]    3    4
[2,]    1    2

matlab documentation built on May 30, 2017, 6:57 a.m.