Power iteration in Matlab.

조회 수: 12 (최근 30일)
A123456
A123456 2016년 2월 10일
답변: Bolivia Correa Tayniz 2021년 9월 24일
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

채택된 답변

Walter Roberson
Walter Roberson 2016년 2월 10일
r = v;
for K = 1 : 30
r = r * G;
end
  댓글 수: 1
Torsten
Torsten 2016년 2월 11일
Note that the vector r in the power iteration method must be normalized in each step:
r = r/norm(r);
Best wishes
Torsten.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Bolivia Correa Tayniz
Bolivia Correa Tayniz 2021년 9월 24일

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by