The matlab command [ P , D ] = e i g ( A ) {\displaystyle [P,D]=\mathrm {eig} (A)} yields the matrix P {\displaystyle P} , whose columns are the eigenvectors of A {\displaystyle A} , and the diagonal matrix D {\displaystyle D} , whose entries are the eigenvalues of A {\displaystyle A} .