MATLAB Function Reference Previous page   Next Page
svds

A few singular values

Syntax

Description

svds(A) computes the five largest singular values and associated singular vectors of the matrix A.

svds(A,k) computes the k largest singular values and associated singular vectors of the matrix A.

svds(A,k,0) computes the k smallest singular values and associated singular vectors.

With one output argument, s is a vector of singular values. With three output arguments and if A is m-by-n:

Algorithm

svds(A,k) uses eigs to find the k largest magnitude eigenvalues and corresponding eigenvectors of B = [0 A; A' 0].

svds(A,k,0) uses eigs to find the 2k smallest magnitude eigenvalues and corresponding eigenvectors of B = [0 A; A' 0], and then selects the k positive eigenvalues and their eigenvectors.

Example

west0479 is a real 479-by-479 sparse matrix. svd calculates all 479 singular values. svds picks out the largest and smallest singular values.

These plots show some of the singular values of west0479 as computed by svd and svds.

The largest singular value of west0479 can be computed a few different ways:

and estimated:

See Also

svd, eigs


Previous page  svd switch Next page

© 1994-2005 The MathWorks, Inc.