Finding eigenvalue - MatLab

  • MATLAB
  • Thread starter liquidFuzz
  • Start date
  • #1
80
0

Main Question or Discussion Point

I'm tinkering with a code snippet where a part finds eigenvalues.
Code:
eig(A);
The thing is, I tried to do it not using eig() to grasp this and got stuck. Could anyone shed some light on this..? How do I find the smallest eigenvalue?
 

Answers and Replies

  • #2
80
0
Hmm... I might be a little bit closer. This seems to compute the biggest eigenvalue.
Code:
    while (abs(lambda - lambda_old) > tol)
        lambda_old = lambda;
        lambda = y'*A*z/norm(z, 2);   %this part should be altered to compute the smallest.
    end
 
  • #3
Pythagorean
Gold Member
4,191
255
d = eig(A) returns a vector of the eigenvalues of matrix A (notice, I'm assigning it to 'd')

to find the smallest value in a vector:

smallest = min(d)

so, all you really have is:

Code:
d = eig(A)
sm = min(d)
where sm is the smallest eigenvalue.
Not quite what matlab calls the smallest when mixing complex numbers with real numbers.
 
  • #4
Pythagorean
Gold Member
4,191
255
ok, weird... so:

according to min, the first entry in A is the "smallest"
Code:
A =

  1.000000000000000 + 1.000000000000000i
 -1.000000000000000 + 1.000000000000000i

>> min(A)

ans =

  1.000000000000000 + 1.000000000000000i
but according to the lessthan sign, the second entry is the "smallest"

Code:
 >> if A(1) < A(2)
dips('YES')
end
>>if A(2) < A(1)
disp('YES')
end
YES
 
  • #5
80
0
I'm trying to set up a power iteration - not using eig(). I'm pretty sure I get the power iteration right, but the inverted power iteration to get the smallest..?
 

Related Threads on Finding eigenvalue - MatLab

  • Last Post
Replies
6
Views
1K
  • Last Post
Replies
2
Views
2K
Replies
1
Views
4K
Replies
0
Views
2K
Replies
3
Views
23K
  • Last Post
Replies
1
Views
586
  • Last Post
Replies
6
Views
5K
Replies
1
Views
1K
Top