필터 지우기
필터 지우기

I need help displaying the eigenvalue after each iteration

조회 수: 2 (최근 30일)
Brandon
Brandon 2023년 11월 29일
답변: Torsten 2023년 11월 29일

답변 (1개)

Torsten
Torsten 2023년 11월 29일
A = rand(10);
ATA = A'*A;
x0 = rand(10,1);
for iter = 1:10
y = ATA*x0;
x = y/norm(y);
x0 = x;
y
end
y = 10×1
13.8330 16.6010 15.4737 18.7605 17.6278 12.7441 19.7612 22.2199 17.2281 15.1539
y = 10×1
8.0529 9.6059 9.0273 10.7622 10.2690 7.4746 11.4399 12.8886 9.9449 8.7585
y = 10×1
8.0555 9.6053 9.0300 10.7568 10.2722 7.4780 11.4398 12.8884 9.9438 8.7575
y = 10×1
8.0556 9.6053 9.0301 10.7565 10.2724 7.4782 11.4398 12.8883 9.9437 8.7575
y = 10×1
8.0556 9.6053 9.0301 10.7565 10.2724 7.4782 11.4398 12.8883 9.9437 8.7575
y = 10×1
8.0556 9.6053 9.0301 10.7565 10.2724 7.4782 11.4398 12.8883 9.9437 8.7575
y = 10×1
8.0556 9.6053 9.0301 10.7565 10.2724 7.4782 11.4398 12.8883 9.9437 8.7575
y = 10×1
8.0556 9.6053 9.0301 10.7565 10.2724 7.4782 11.4398 12.8883 9.9437 8.7575
y = 10×1
8.0556 9.6053 9.0301 10.7565 10.2724 7.4782 11.4398 12.8883 9.9437 8.7575
y = 10×1
8.0556 9.6053 9.0301 10.7565 10.2724 7.4782 11.4398 12.8883 9.9437 8.7575
largest_eigenvalue_approx = x'*ATA*x
largest_eigenvalue_approx = 31.4387
max(eig(ATA))
ans = 31.4387

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by