matlab coding for simple subspace iteration
9 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I wrote the code for the simple subspace iteration but it does not seem to work properly. Here is my code
function [v,lamda] = SSI(A,tol)
n=size(A,1);
v=rand(n);
res=1;
while (res > tol)
W = A*v;
[Q,R] = qr(W);
v = Q;
res = norm(W-A*v);
end
and the algorithm is as follows
Choose an initial system of vectors v_{0}
Iterate: Until convergence do,
v_{k} = Av_{k-1}
v_{k} = QR the QR factorisation of v_{k} and set v_{k} = Q
Thanks in advance
1 comentario
Geoff Hayes
el 3 de Mayo de 2014
Editada: Geoff Hayes
el 3 de Mayo de 2014
Please clarify what is meant by "…does not seem to work properly". What exactly doesn't work properly in your algorithm? Is the error something like "not all output parameters are set"? The output parameter lambda is not being set to anything so that could be a problem. Else this code looks awfully similar to ssi problem.
Respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!