Previous Up Next

15.3.8  Singular value decomposition

The singular value decomposition of a matrix A is a factorization A=USQT, where U and Q are orthogonal and S is a diagonal matrix. The svd command finds the singular value decomposition of a matrix.

You can get the diagonal matrix S from s with S=diag(s) (see Section 14.2.2).

Examples

svd([[1,2],[3,4]])
     
 


−0.404553584834−0.914514295677
−0.9145142956770.404553584834


,
5.46498570422,0.365966190626
,
         
 


−0.5760484367660.81741556047
−0.81741556047−0.576048436766


         
(U,s,Q):=svd([[3,5],[4,5]])
     
 


−0.672988041811−0.739653361771
−0.7396533617710.672988041811


,
8.6409011028,0.578643354497
,
         
 


−0.5760484367660.81741556047
−0.81741556047−0.576048436766


         

Verification:

U*diag(s)*tran(Q)
     


3.05.0
4.05.0


          

Previous Up Next