MATLAB Function Reference
  Go to function:
    Search    Help Desk 
svd    Examples

Singular value decomposition

Syntax

Description

The svd command computes the matrix singular value decomposition.

s = svd(X) returns a vector of singular values.

[U,S,V] = svd(X) produces a diagonal matrix S of the same dimension as X, with nonnegative diagonal elements in decreasing order, and unitary matrices U and V so that X = U*S*V'.

[U,S,V] = svd(X,0) produces the "economy size" decomposition. If X is m-by-n with m > n, then svd computes only the first n columns of U and S is n-by-n.

Examples

For the matrix

the statement

produces

The economy size decomposition generated by

produces

Algorithm

The svd command uses the LINPACK routine ZSVDC.

Diagnostics

If the limit of 75 QR step iterations is exhausted while seeking a singular value, this message appears:

References

[1] Dongarra, J.J., J.R. Bunch, C.B. Moler, and G.W. Stewart, LINPACK Users' Guide, SIAM, Philadelphia, 1979.



[ Previous | Help Desk | Next ]