svd
Singular value decomposition.
Syntax
Section titled “Syntax”S = svd(X)[U, S, V] = svd(X)[U, S, V] = svd(X, 0) % economy size[U, S, V] = svd(X, 'econ') % economy sizeDescription
Section titled “Description”Computes the SVD of X: orthogonal/unitary U, diagonal nonnegative S, orthogonal/unitary V such that X = U*S*V'. With one return, gives just the singular values as a vector.
The economy form (passing 0 or 'econ' as the second argument) returns U and V truncated to the smaller dimension — significantly cheaper for tall or wide matrices.
Examples
Section titled “Examples”[U, S, V] = svd([1 2; 3 4; 5 6]);size(U) % [3 3] full form[U, S, V] = svd([1 2; 3 4; 5 6], 'econ');size(U) % [3 2] economy