Graphics Programs Reference
In-Depth Information
v = v*vSign;
if sqrt(dot(vOld - v,vOld - v)) < 1.0e-6
eVal = vSign*zMag
numIter = i
return
end
end
error('Too many iterations')
The results are:
>> eVal =
70.9435
numIter =
93
Note that it took 93 iterationstoreach convergence.
EXAMPLE 9.5
Determine the smallest eigenvalue
λ 1 and the corresponding eigenvector of
12314
29352
3315 4 3
15 4 12 4
4 234 17
A
=
Use the inverse powermethodwith eigenvalueshifting knowing that
λ 1
5.
Solution
% Example 9.5 (Inverse power method)
s=5;
A=[11 2 3 1 4;
2935 ;
33 54 ;
154124;
423417];
[eVal,eVec] = invPower(A,s)
Here is the output:
>> eVal =
4.8739
eVec =
0.2673
Search WWH ::




Custom Search