View source: R/characteristicPolynomial.R
characteristicPolynomial | R Documentation |
Characteristic polynomial of a matrix.
characteristicPolynomial(A)
A |
a square matrix with numeric, character, or |
A univariate qspray
polynomial.
set.seed(666)
A <- matrix(rpois(9L, 10), nrow = 3, ncol = 3)
( P <- characteristicPolynomial(A) )
# check the roots are the eigen values:
f <- as.function(P, N = TRUE)
sapply(eigen(A)$values, f) # approx c(0, 0, 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.