svd

  • svd(X) returns singular values vector resulting from singular values decomposition of matrix X
  • [U,S,V] = svd(X) returns diagonal matrix S and unitary matrices U and V such that X = U * S * V'
  • [U,S,V] = svd(X,0) returns "thin" matrices U and V

Examples

> X = [1 2; 3 4; 5 6]#

            1            2
            3            4
            5            6

> [U S V] = svd(X);disp(U);disp(S);disp(V)

U =

     0.229848    -0.883461     0.408248
     0.524745    -0.240782    -0.816497
     0.819642     0.401896     0.408248

S =

      9.52552            0
            0     0.514301
            0            0

V =

     0.619629     0.784894
     0.784894    -0.619629

[U:3x3 double]
[S:3x2 double]
[V:2x2 double]

> [U S V] = svd(X,0);disp(U);disp(S);disp(V)

U =

     0.229848    -0.883461
     0.524745    -0.240782
     0.819642     0.401896

S =

      9.52552            0
            0     0.514301
            0            0

V =

     0.619629     0.784894
     0.784894    -0.619629

[U:3x2 double]
[S:3x2 double]
[V:2x2 double]

Resources

See also

chol | eig | lu