We use the QR-decomposition to obtain the eigenvalues of a matrix. The method is iterative and builds an upper-triangular matrix. The eigenvalues appear as the diagonal terms of this upper-triangular matrix. These values are found to be in agreement with those given by the Matlab built-in function: eig. A similar program using Mathematica is available at the following link:
Housam Binous (2021). Determination of the Eigenvalues using the QR-Decomposition (https://www.mathworks.com/matlabcentral/fileexchange/13813-determination-of-the-eigenvalues-using-the-qr-decomposition), MATLAB Central File Exchange. Retrieved .
This code is not giving correct result for this matrix:
A=[1, 1, 0; 1, 0, 1; 0, 1, 1]
can someone please tell me why?
I recommend not to download this piece of code, because it is neither useful nor usable. "[Q,R]=qr(M); M=R*Q;" is calculated 100 times. This is *not* a smart method to determine eigenvalues reliably.
Very excellent but maybe not work in complex eigenvalue, see the following link,
If the matrix is near sigular or sigular, does your code work right? Thanks.
Here is what is in the script M-file:
A=[2., 3, 4, 5; 4, 2., 5, 6; 5, 7, 2., 7; 6, 8, 10, 2.];
[Q,R] = qr(M);
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!