In linear algebra, Wilkinson matrices are symmetric, tridiagonal, order-N matrices with pairs of nearly, but not exactly, equal eigenvalues. Wilkinson matrices have applications in many fields, including scientific computing, numerical linear algebra, and signal processing.(Wikipedia)
Following the matrix example from wikipedia, I have this matrix:
[,1] [,2] [,3] [,4] [,5] [,6] [,7]
[1,] 3 1 0 0 0 0 0
[2,] 1 2 1 0 0 0 0
[3,] 0 1 1 1 0 0 0
[4,] 0 0 1 0 1 0 0
[5,] 0 0 0 1 1 1 0
[6,] 0 0 0 0 1 2 1
[7,] 0 0 0 0 0 1 3
How can I create this matrix and compute the eigenvalues in R?