Created
March 25, 2016 07:18
-
-
Save hurutoriya/33e15829f02552a8ac13 to your computer and use it in GitHub Desktop.
Power Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 5; | |
res = 10^(-13); | |
A = rand(n,n); | |
A = A'+A; | |
x = rand(n,1) | |
x_1 = A*x; | |
ite = 0; | |
while res < abs(norm(x_1)-norm(x)) | |
ite = ite +1 | |
x = x_1 | |
x_1 = A*x; | |
x_1 = x_1/norm(x_1); | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment