Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

QR decomposition in matlab

Status
Not open for further replies.

varuniyengar

Advanced Member level 4
Full Member level 1
Joined
Jan 18, 2011
Messages
107
Helped
17
Reputation
34
Reaction score
17
Trophy points
1,298
Activity points
1,743
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
 

Why "not work well with complex" ?
The only detail is that your code calculates A = QT' * R instead of A = QT * R
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top