필터 지우기
필터 지우기

how to compute orthonormal vectors via Lanczos process?

조회 수: 1 (최근 30일)
Omar B.
Omar B. 2019년 8월 27일
Hello,
How to initialize vector in Matlab? could you please check what I did ( I want to start with V_0=0 , beta (0)=0 , V(:,1) = V/norm(V,2))
Also, how can we creat a matrix collect all V's we have found ? ( i.e Q=[ V_1 V_2 ... V_j+1] )
My code:
function [] = lanczos(A, m)
[n,k] = size(A);
V(:,0)=0;
V(:,1) = ones(k,1);
V(:,1)=V(:,1)/norm(V(:,1),2);
beta(0)=0;
for j=1:m
w = A*V(:,j) - V(:,j-1)*beta(j-1);
alpha(j-1) = V(:,j)'.* w;
w = w - V(:,j)* alpha(j-1);
beta(j) = norm(w,2);
V(:,j+1) = w/beta(j);
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Just for fun에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by