File Exchange

image thumbnail

Determination of the Eigenvalues using the QR-Decomposition

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


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:

Cite As

Housam Binous (2021). Determination of the Eigenvalues using the QR-Decomposition (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (7)


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?


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,


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

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

Community Treasure Hunt

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

Start Hunting!