charpoly(a, info = FALSE)
cp
, the characteristic polynomial, det
, the
determinant, and inv
, the inverse matrix, will be returned.a <- magic(5)
A <- charpoly(a, info = TRUE)
A$cp
roots(A$cp)
A$det
zapsmall(A$inv %*% a)
Run the code above in your browser using DataLab