Learn R Programming

biotools (version 3.1)

raise.matrix: Raising a Square Matrix to a Power

Description

raise.matrix raises a square matrix to a power by using spectral decomposition.

Usage

raise.matrix(x, power = 1)

Arguments

x

a square matrix.

power

numeric; default is 1.

Value

An object of class "matrix".

See Also

eigen, svd

Examples

Run this code
# NOT RUN {
m <- matrix(c(1, -2, -2, 4), 2, 2)
raise.matrix(m)
raise.matrix(m, 2)

# End (not run)
# }

Run the code above in your browser using DataLab