[討論] Givens Rotation: a 3x3 matrix illust …

看板NCTU-STAT99G作者 (aluba1)時間13年前 (2011/05/19 11:07), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
The following is the matlab code to transform a 3x3 matrix to an upper triangualr one. Please copy them into matlab command window line by line to see the result: p1=0.9; p2=p1*p1; A=[1 p1 p2; p1 1 p1; p2 p1 1] theta=(A(1,1)^2+A(2,1)^2)^(0.5); theta=A(1,1)/theta; theta=acos(theta); B=[cos(theta) sin(theta) 0; -sin(theta) cos(theta) 0; 0 0 1]; A=B*A theta=(A(1,1)^2+A(3,1)^2)^(0.5); theta=A(1,1)/theta; theta=acos(theta); B=[cos(theta) 0 sin(theta); 0 1 0;-sin(theta) 0 cos(theta)]; A=B*A theta=(A(2,2)^2+A(3,2)^2)^(0.5); theta=A(2,2)/theta; theta=acos(theta); B=[1 0 0; 0 cos(theta) sin(theta);0 -sin(theta) cos(theta)]; A=B*A Now you have an upper triangular matrix. I hope this will help you to understand how Givens works. aluba1. -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 123.195.2.128 ※ 編輯: aluba1 來自: 123.195.2.128 (05/21 05:27)

05/21 18:54, , 1F
Thanks for your help~ push the article
05/21 18:54, 1F
文章代碼(AID): #1Dr8bzI9 (NCTU-STAT99G)