フィルターのクリア

Householder Reflection QR=A

11 ビュー (過去 30 日間)
Ismail Güclü
Ismail Güclü 2020 年 8 月 26 日
コメント済み: VIERI 2023 年 4 月 28 日
function [Q,R] = househ(A)
%QR-Zerlegung mit Householder
[m,n]=size(A);
Q = eye(m);
D = eye(m);
p = min(m-1,n);
for k=1:p
%untermatrix erstellen / define sub-matrix
x = A(:,k);
if k == 1
x = A(:,k);
elseif k <= p
for i = 1:(k-1)
x(i) = 0;
end
else
continue
end
%Formeln aus dem Buch / equation of the book
a = -sign(A(k,k))*norm(x);
v = x - a*D(:,k);
H = D-2*(v*v')/(v'*v);
% ---------------------------------
if k == 1
Q=H;
else
Q = Q*H;
end
A=H*A;
end
A(find(A==-0))=0; % unnecessary
R=A;
Q=Q';
end
Here u can see my Householder transformation. The Code under the hyphens is wrong but I don´t know why ... can someone help me.
  1 件のコメント
VIERI
VIERI 2023 年 4 月 28 日
it doesent work

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

回答 (1 件)

Monisha Nalluru
Monisha Nalluru 2020 年 9 月 18 日
Refer to this blog post which explains on Household Refelection and Household QR factorization with sample code for understanding.

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by