$$\begin{bmatrix} -1 & 1 & 0 &\dots &\dots &\dots &0\\ 1 & -2 & 1 & \ddots & & & \vdots\\ 0 & 1 & -2 & \ddots & \ddots & & \vdots\\ \vdots & \ddots & \ddots & \ddots & \ddots & \ddots & \vdots\\ \vdots & & \ddots & \ddots & -2 & 1 & 0\\ \vdots & & & \ddots & 1 & -2 & 1\\ 0 & \dots & \dots & \dots & 0 & 1 & -1\\ \end{bmatrix}\in \mathbb{R}^{N\times N}$$
Is the matrix I'm trying to solve. I'm trying to figure out what to do in MATLAB, but I'm not familiar with the program to use it. What is the process one would to to solve for the eigen values for this matrix?
Using
diagyou can create your matrix 1. Usingeigyou can determine the eigenvalues 2. Here is the code:You can alter $n$ to change the size of the matrix. Because we are using MATLAB we can easily visualize the eigenvalues for different $n$. With this code:
We can create this picture, with the eigenvalues on the x-axis and the size of the matrix on the y-axis. You can see a pattern, you can prove why this is.