Power iteration in Matlab.
12 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
A123456
el 10 de Feb. de 2016
Respondida: Bolivia Correa Tayniz
el 24 de Sept. de 2021
How can I implement the power iteration method in matlab? I have a vector, v and a matrix, G, I need to multiply them together using the answer in the previous iterate continuously until it converges to a constant vector. So about 20-30 iterations will need to be done.
v = 0.2669 0.1413 0.3570 0.3836 0.5105 0.6112
G =
0.1667 0.1667 0.1667 0.1667 0.1667 0.1667
0.8750 0.0250 0.0250 0.0250 0.0250 0.0250
0.8750 0.0250 0.0250 0.0250 0.0250 0.0250
0.3083 0.5917 0.0250 0.0250 0.0250 0.0250
0.8750 0.0250 0.0250 0.0250 0.0250 0.0250
0.3083 0.3083 0.3083 0.0250 0.0250 0.0250
0 comentarios
Respuesta aceptada
Walter Roberson
el 10 de Feb. de 2016
r = v;
for K = 1 : 30
r = r * G;
end
1 comentario
Torsten
el 11 de Feb. de 2016
Note that the vector r in the power iteration method must be normalized in each step:
r = r/norm(r);
Best wishes
Torsten.
Más respuestas (1)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!