 
 
 
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.
- 
svd takes
A, a numeric square matrix.
- svd(A) returns a list [U,s,Q] where U and Q
are the orthogonal matrices of the singular value decomposition and
s is the diagonal of the matrix S.
You can get the diagonal matrix S from s with S=diag(s)
(see Section 14.2.2).
Examples
|  | |  | | | ⎡ ⎢
 ⎣
 | | −0.404553584834 | −0.914514295677 |  | −0.914514295677 | 0.404553584834 | 
 | ⎤ ⎥
 ⎦
 | 
 | , | ⎡ ⎣
 | 5.46498570422,0.365966190626 | ⎤ ⎦
 | , | 
 |  |  |  |  |  |  |  |  |  |  |  | | ⎡ ⎢
 ⎣
 | | −0.576048436766 | 0.81741556047 |  | −0.81741556047 | −0.576048436766 | 
 | ⎤ ⎥
 ⎦
 | 
 |  |  |  |  |  |  |  |  |  | 
 | 
| (U,s,Q):=svd([[3,5],[4,5]]) | 
|  | |  | | | ⎡ ⎢
 ⎣
 | | −0.672988041811 | −0.739653361771 |  | −0.739653361771 | 0.672988041811 | 
 | ⎤ ⎥
 ⎦
 | 
 | , | ⎡ ⎣
 | 8.6409011028,0.578643354497 | ⎤ ⎦
 | , | 
 |  |  |  |  |  |  |  |  |  |  |  | | ⎡ ⎢
 ⎣
 | | −0.576048436766 | 0.81741556047 |  | −0.81741556047 | −0.576048436766 | 
 | ⎤ ⎥
 ⎦
 | 
 |  |  |  |  |  |  |  |  |  | 
 | 
Verification:
 
 
