File Exchange

image thumbnail

Determination of the Eigenvalues using the QR-Decomposition

version 1.0.0.0 (454 Bytes) by Housam Binous
computes eigenvalues using QR decomposition

8 Downloads

Updated 31 Jan 2007

No License

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:
http://library.wolfram.com/infocenter/MathSource/6612/

Cite As

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 .

Comments and Ratings (7)

Aras

Ashutosh kumar

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?

Jan

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.

Longjiang Yu

Very excellent but maybe not work in complex eigenvalue, see the following link,
http://facstaff.unca.edu/mcmcclur/class/LinearII/presentations/html/QRAlgorithms.html

Nikolay

Jackie Li

If the matrix is near sigular or sigular, does your code work right? Thanks.

Duane Hanselman

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.];
M=A
for i=1:100;
[Q,R] = qr(M);
M=R*Q;
end
M
eig(A)

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!