MATLAB: Does the EIGS function not return the correct result when I try to find the smallest eigenvalue using the “SM” option in MATLAB 6.5 (R13)

eigsincorrectMATLABresultsmallestvalue

Why does the EIGS function not return the correct result when I try to find the smallest eigenvalue using the "SM" option in MATLAB 6.5 (R13)?
Consider the following matrix:
A=[1.0082 0.2207
0.0004 1.0639];
eig(A)
ans =
1.0067
1.0654
The above shows that the smallest eigenvalue is 1.0067. However, when I use the EIGS function, I do not get the same result:
eigs(A,1,'SM')
ans =
1.0654
Is this a bug with EIGS?

Best Answer

This bug has been fixed in Release 14 Service Pack 2 (R14SP2). For previous releases, please read below for any possible workarounds:
This is a bug with the EIGS function. The development team is currently investigating the issue.
If you are interested in obtaining the smallest real part of the eigenvalues, use the "SR" option.
[v.d] = eigs(A,1, 'sr');
Note that for smaller matrices (matrices that can fit into memory), it is advisable to use the EIG function instead of EIGS. The EIG function is faster and more efficient than EIGS in such cases.