- #1

- 80

- 0

Code:

`eig(A);`

You are using an out of date browser. It may not display this or other websites correctly.

You should upgrade or use an alternative browser.

You should upgrade or use an alternative browser.

- MATLAB
- Thread starter liquidFuzz
- Start date

- #1

- 80

- 0

Code:

`eig(A);`

- #2

- 80

- 0

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,214

- 272

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,214

- 272

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

Share:

- Replies
- 11

- Views
- 5K

- Replies
- 0

- Views
- 2K