Calculates the n-th power of a matrix

Share:

Description

Calculates the n-th power of a matrix.

Usage

1
mtx.exp(X, n)

Arguments

X

a square matrix

n

the exponential value

Details

This function calculates (efficiently!) the n-th power of a matrix.

Value

Takes a matrix and returns a matrix.

Note

Original code by VCC "beautyfied" by MM

Author(s)

Vincente Canto Cassola and Martin Maechler

References

...

Examples

1
2
3
test<-matrix(c(1:16), 4,4)
pow.test<-mtx.exp(test,10)
pow.test