Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help with the coding solution. I can do it but I am not sure about my ans

ID: 2248767 • Letter: I

Question


I need help with the coding solution. I can do it but I am not sure about my answer. pls do it and I will gladly rate.

1. [ (10 points] Use the Power method to determine the dominant eigenvalue and the corresponding eigenvector of the following matrix, by writing a MATLAB pro gram 10 Solve until the approximate percent relative error of the eigenvalue becomes less than or equal to 0.1 Your program must dispaly the (i) Converged value of the dominant eigenvalue (upto at least 4 decimal places) (zi) Correspoding eigenvector, and (iii) Number of iterations to converge (excluseds the O'h iteration)

Explanation / Answer

1. the code is given below with solutions

clc
clear
A = [2 8 10; 8 4 5; 10 5 7];
V1=[1; 1; 1]; % intitial vector
x1=A*V1; % zeroth iteration
[val] = max(x1);
y1 = x1*(1/val);
x2=A*y1; % first iteration
[val1] = max(x2);
y2 = x1*(1/val1);
loopcount=1;

while abs((val1-val)/val1)>0.001

val=val1;
x2=A*y2;
[val1] = max(x2);
y2 = x2*(1/val1);
loopcount=loopcount+1;
end
  
display(val1); % converged value of dominant eigan value
display(y2); % corresponsing eigan vector
display(loopcount); % how may iterations to converge excluding 0th iteration

Solutions are

val1 = 19.8895


y2 =

0.9033
0.7698
1.0000


loopcount = 4