Home >Common Problem >How to find eigenvalues ​​in matlab

How to find eigenvalues ​​in matlab

藏色散人
藏色散人Original
2020-02-20 09:54:5927879browse

How to find eigenvalues ​​in matlab

How to find eigenvalues ​​in matlab?

Methods for finding the eigenvalues ​​and eigenvectors of a matrix

Methods/steps

In the first step, we first need to know what is used to calculate the eigenvalues ​​and eigenvectors of a matrix eig function, you can enter help eig in the command line window to check the usage of the eig function, as shown in the following figure:

How to find eigenvalues ​​in matlab

The second step is to enter a in the command line window =[1 2 3;2 4 5;7 8 9], after pressing the Enter key, enter [x,y]=eig(a), as shown in the following figure:

How to find eigenvalues ​​in matlab

In the third step, after pressing the Enter key, the values ​​of x and y are obtained. Each column value of x represents an eigenvector of the matrix a. There are 3 eigenvectors here. The diagonal element value of y represents the matrix a. The eigenvalues ​​of , as shown in the figure below:

How to find eigenvalues ​​in matlab

Step 4 If we want to take the diagonal element value of y, we can use diag(y), as shown in the figure below:

How to find eigenvalues ​​in matlab

In the fifth step, after pressing the Enter key, you can see that the diagonal element value of y has been taken out, which is the eigenvalue of the a matrix, as shown in the following figure:

How to find eigenvalues ​​in matlab

In the sixth step, we can also help diag in the command line window, and you can see the usage of the diag function, as shown in the following figure:

How to find eigenvalues ​​in matlab

For more programming-related content, please pay attention to the Programming Introduction column on the php Chinese website!

The above is the detailed content of How to find eigenvalues ​​in matlab. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn