|MATLAB Function Reference|
Generalized singular value decomposition
[U,V,X,C,S] = gsvd(A,B)
returns unitary matrices
V, a (usually) square matrix
X, and nonnegative diagonal matrices
S so that
B must have the same number of columns, but may have different numbers of rows. If
q = min(m+n,p).
sigma = gsvd(A,B)
returns the vector of generalized singular values,
The nonzero elements of
S are always on its main diagonal. If
m >= p the nonzero elements of
C are also on its main diagonal. But if
m < p, the nonzero diagonal of
diag(C,p-m). This allows the diagonal elements to be ordered so that the generalized singular values are nondecreasing.
gsvd(A,B,0), with three input arguments and either
n >= p, produces the "economy-sized" decomposition where the resulting
V have at most
p columns, and
S have at most
p rows. The generalized singular values are
B is square and nonsingular, the generalized singular values,
gsvd(A,B), are equal to the ordinary singular values,
svd(A/B), but they are sorted in the opposite order. Their reciprocals are
In this formulation of the
gsvd, no assumptions are made about the individual ranks of
B. The matrix
X has full rank if and only if the matrix
[A;B] has full rank. In fact,
cond(X) are are equal to
cond([A;B]). Other formulations, eg. G. Golub and C. Van Loan , require that
null(B) do not overlap and replace
Note, however, that when
null(B) do overlap, the nonzero elements of
S are not uniquely determined.
Example 1. The matrices have at least as many rows as columns.
produces a 5-by-5 orthogonal
U, a 3-by-3 orthogonal
V, a 3-by-3 nonsingular
A is rank deficient, the first diagonal element of
C is zero.
The economy sized decomposition,
produces a 5-by-3 matrix
U and a 3-by-3 matrix
The other three matrices,
S are the same as those obtained with the full decomposition.
The generalized singular values are the ratios of the diagonal elements of
These values are a reordering of the ordinary singular values
Example 2. The matrices have at least as many columns as rows.
produces a 3-by-3 orthogonal
U, a 5-by-5 orthogonal
V, a 5-by-5 nonsingular
In this situation, the nonzero diagonal of
diag(C,2). The generalized singular values include three zeros.
Reversing the roles of
B reciprocates these values, producing two infinities.
The generalized singular value decomposition uses the C-S decomposition described in , as well as the built-in
qr functions. The C-S decomposition is implemented in a subfunction in the
The only warning or error message produced by
gsvd itself occurs when the two input arguments do not have the same number of columns.
 Golub, Gene H. and Charles Van Loan, Matrix Computations, Third Edition, Johns Hopkins University Press, Baltimore, 1996