Jacobi Plane rotation for a matrix A
4 views (last 30 days)
Show older comments
How to perform the Jacobi Rotation (Jacobi Method) for given matrix
There exists a rotation (c = cos(theta) and s = sin(theta))
For example how can we estimate rotation for the following matrix
A = [-17.7147 -38.4117 30.6475
-51.3024 17.3859 -10.0354
-19.3323 -38.8931 30.3686
-51.2891 18.9043 -11.1523
-21.42 -39.2796 29.9065
-51.1701 20.7146 -12.4891
-24.2543 -39.5276 29.3515
-51.0782 22.9095 -14.1458]
Using C++ Eigen libaray the result is following: http://eigen.tuxfamily.org/dox-3.2/classEigen_1_1JacobiRotation.html
Result = [ 110.564 -7.77137 -0.308057
0 87.445 -64.7691
0 0 1.86159
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0]
Using matlab inbuilt function qr ([~,R]=qr(A)) gives me the following:
R = [ 110.5645 -7.7714 -0.3081
0 -87.4451 64.7691
0 0 -1.8616
0 0 0
0 0 0
0 0 0
0 0 0
0 0 0]
As you can see the first row result is same in C++ and matlab.
whereas the second and third row signs are not matching.
What is the correct solution or how can it be implemented in matlab?
Thank you!!
0 Comments
Answers (1)
KSSV
on 21 Aug 2020
Define the ngle of your rotation theta:
A = [-17.7147 -38.4117 30.6475
-51.3024 17.3859 -10.0354
-19.3323 -38.8931 30.3686
-51.2891 18.9043 -11.1523
-21.42 -39.2796 29.9065
-51.1701 20.7146 -12.4891
-24.2543 -39.5276 29.3515
-51.0782 22.9095 -14.1458] ;
theta = pi/4 ;
R = [cos(theta) sin(theta) 0 ;
-sin(theta) cos(theta) 0 ;
0 0 1] ;
Ar = A*R
1 Comment
See Also
Categories
Find more on Linear Algebra in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!