svd
Singular value decomposition of a real or complex matrix.
sv=svd(a)
(u, s, v)=svd(a)
Inputs
a The matrix to be decomposed.
Outputs
sv The vector of singular values of a .
u A square unitary matrix with the same number of rows as a .
s A matrix of the same size as a with zero entries except on the main diagnoal, which contains the singular values.
v A square unitary matrix with the same number of columns as a .


Description
The matrices satisfy the identity u*s*v'=a .
Example
>>a=magic(4)
>>a
         16          2          3         13
          5         11         10          8
          9          7          6         12
          4         14         15          1

>>S=svd(a)
>>S
   34.0000
   17.8885
    4.4721
         0

>>(u,s,v)=svd(a)
>>u
    0.5000   -0.6708    0.5000   -0.2236
    0.5000    0.2236   -0.5000   -0.6708
    0.5000   -0.2236   -0.5000    0.6708
    0.5000    0.6708    0.5000    0.2236

>>s
   34.0000         0         0         0
         0   17.8885         0         0
         0         0    4.4721         0
         0         0         0         0

>>v
    0.5000   -0.5000    0.6708   -0.2236
    0.5000    0.5000   -0.2236   -0.6708
    0.5000    0.5000    0.2236    0.6708
    0.5000   -0.5000   -0.6708    0.2236

>>norm(u*s*v'-a)
      2.1316e-014