powered by
Performs the matrix power operation.
MatrixPower(A, n)
A square matrix.
An integer telling the exponent.
A matrix of the same dimension as A.
A
Only well defined for integers the matrix power operation is a convenience function to multiply a matrix, A, with itself n times.
n
# 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