updating my matlab code for Arnoldi iteration

Actually this code is going to break the matrix into 2 parts, the orthogonal basis "Q" and the a Hessenberg matrix "H". The remaining job is to take part of the hessenberg matrix "H" (to neglect the last row of zero),and apply a simple function in matlab on the matrix "H" to calculate its eigenvalue. Eg lamda=eig(H)
Here is my coding
function[Q,H]=Arnoldi(A,k,b)
m=length(b);
H=zeros(k);
Q=zeros(m,k);
Q(:,1)=b/norm(b);
for n=1:k
v=A*Q(:,n);
for j=1:n
H(j,n)=Q(:,j)'*v;
v=v-H(j,n)*Q(:,j);
end
H(n+1,n)=norm(v);
Q(:,n+1)=v/H(n+1,n);
end
Thanks in advance

2 件のコメント

Jan
Jan 2014 年 5 月 11 日
What is your question? Do you want us to solve your job?

サインインしてコメントする。

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSparse Matrices についてさらに検索

質問済み:

2014 年 5 月 11 日

コメント済み:

Jan
2014 年 5 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by