varuniyengar
Advanced Member level 4
Can some one help me out in finding the QR decomposition of a Hermitian matrix
the code that i have written does not work well with complex
clc
clear all
close all
%A = [1 1 1; 1 1 0 ; 1 1 2];
A = [1+6j 1-4j 3-2j; 1+4j 8-1j 2+4j ; 3+2j 2-4j 2];
[qq rr] = qr(A);
[m n] = size(A);
r = zeros(n,n);mm=0;
QT = zeros(n,m);
Q = A;
for k=1:n
QT(k, = A,k)';
end
for k = 1:n
r(k,k) = sqrt(QT(k,*QT(k,');
QT(k, = QT(k,/r(k,k);
if(k<n)
for j=k+1:n
r(k,j)= (A,j)'*QT(k,')';
QT(j,= (QT(j,'-(r(k,j)*QT(k,'))';
end
end
end
thanks in adv
the code that i have written does not work well with complex
clc
clear all
close all
%A = [1 1 1; 1 1 0 ; 1 1 2];
A = [1+6j 1-4j 3-2j; 1+4j 8-1j 2+4j ; 3+2j 2-4j 2];
[qq rr] = qr(A);
[m n] = size(A);
r = zeros(n,n);mm=0;
QT = zeros(n,m);
Q = A;
for k=1:n
QT(k, = A,k)';
end
for k = 1:n
r(k,k) = sqrt(QT(k,*QT(k,');
QT(k, = QT(k,/r(k,k);
if(k<n)
for j=k+1:n
r(k,j)= (A,j)'*QT(k,')';
QT(j,= (QT(j,'-(r(k,j)*QT(k,'))';
end
end
end
thanks in adv