Learn R Programming

orthogonalsplinebasis (version 0.1.7)

MatrixPower: Matrix Power

Description

Performs the matrix power operation.

Usage

MatrixPower(A, n)

Arguments

A

A square matrix.

n

An integer telling the exponent.

Value

A matrix of the same dimension as A.

Details

Only well defined for integers the matrix power operation is a convenience function to multiply a matrix, A, with itself n times.

Examples

Run this code
# NOT RUN {
A<-rbind(0,cbind(diag(1:5),0))  #a nilpotent matrix
A
MatrixPower(A,3)
MatrixPower(A,5)
MatrixPower(A,6)    #Gets to a zero matrix
# }

Run the code above in your browser using DataLab