Function Reference
— Loadable Function: s = svd (a)
— Loadable Function: [u, s, v] = svd (a)

Compute the singular value decomposition of a

The function svd normally returns the vector of singular values. If asked for three return values, it computes For example,

          svd (hilb (3))

returns

          ans =
          
           1.4083189
           0.1223271
           0.0026873

and

          [u, s, v] = svd (hilb (3))

returns

          u =
          
           -0.82704   0.54745   0.12766
           -0.45986  -0.52829  -0.71375
           -0.32330  -0.64901   0.68867
          
          s =
          
           1.40832  0.00000  0.00000
           0.00000  0.12233  0.00000
           0.00000  0.00000  0.00269
          
          v =
          
           -0.82704   0.54745   0.12766
           -0.45986  -0.52829  -0.71375
           -0.32330  -0.64901   0.68867

If given a second argument, svd returns an economy-sized decomposition, eliminating the unnecessary rows or columns of u or v.