Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Subset of singular values and vectors

`s = svds(A)`

`s = svds(A,k)`

`s = svds(A,k,sigma)`

`s = svds(A,k,sigma,Name,Value)`

`s = svds(A,k,sigma,opts)`

`s = svds(Afun,n,___)`

```
[U,S,V]
= svds(___)
```

```
[U,S,V,flag]
= svds(___)
```

specifies additional options with one or more name-value pair arguments. For
example, `s`

= svds(`A`

,`k`

,`sigma`

,`Name,Value`

)`svds(A,k,sigma,'Tolerance',1e-3)`

adjusts the
convergence tolerance for the algorithm.

`svds`

generates the default starting vectors using a private random number stream to ensure reproducibility across runs. Setting the random number generator state using`rng`

before calling`svds`

does not affect the output.Using

`svds`

is not the most efficient way to find a few singular values of small, dense matrices. For such problems, using`svd(full(A))`

might be quicker. For example, finding three singular values in a 500-by-500 matrix is a relatively small problem that`svd`

can handle easily.If

`svds`

fails to converge for a given matrix, increase the size of the Krylov subspace by increasing the value of`'SubspaceDimension'`

. As secondary options, adjusting the maximum number of iterations (`'MaxIterations'`

) and the convergence tolerance (`'Tolerance'`

) also can help with convergence behavior.Increasing

`k`

can sometimes improve performance, especially when the matrix has repeated singular values.

[1] Baglama, J. and L. Reichel, “Augmented Implicitly
Restarted Lanczos Bidiagonalization Methods.” *SIAM
Journal on Scientific Computing*. Vol. 27, 2005, pp. 19–42.

[2] Larsen, R. M. “Lanczos Bidiagonalization with partial reorthogonalization.”
*Dept. of Computer Science, Aarhus University*. DAIMI PB-357,
1998.