pagesvd
Description
returns
the singular values of each
page of a multidimensional array. Each page of the output S
= pagesvd(X
)S(:,:,i)
is a
column vector containing the singular values of X(:,:,i)
in decreasing
order. If each page of X
is an
m
-by-n
matrix, then the number of singular values
returned on each page of S
is min(m,n)
.
[
computes the singular value decomposition of each page of a multidimensional array. The
pages in the output arrays satisfy: U
,S
,V
] = pagesvd(X
)U(:,:,i) * S(:,:,i) * V(:,:,i)' =
X(:,:,i)
.
S
has the same size as X
, and each page of
S
is a diagonal matrix with nonnegative singular values in decreasing
order. The pages of U
and V
are unitary
matrices.
If X
has more than three dimensions, then
pagesvd
returns arrays with the same number of dimensions:
U(:,:,i,j,k) * S(:,:,i,j,k) * V(:,:,i,j,k)' = X(:,:,i,j,k)
[___] = pagesvd(
produces
an economy-size decomposition of the pages of X
,"econ")X
using either of the
previous output argument combinations. If X
is an
m
-by-n
-by-p
array, then:
m > n
— Only the firstn
columns of each page ofU
are computed, andS
has sizen
-by-n
-by-p
.m = n
—pagesvd(X,"econ")
is equivalent topagesvd(X)
.m < n
— Only the firstm
columns of each page ofV
are computed, andS
has sizem
-by-m
-by-p
.
The economy-size decomposition removes extra rows or columns of zeros from the pages of
singular values in S
, along with the columns in either
U
or V
that multiply those zeros in the expression
U(:,:,i) * S(:,:,i) * V(:,:,i)'
. Removing these zeros and columns can
improve execution time and reduce storage requirements without compromising the accuracy of
the decomposition.
[___] = pagesvd(___,
specifies the output format for the singular values returned in outputForm
)S
. You
can use this option with any of the previous input or output argument combinations. Specify
"vector"
to return each page of S
as a column
vector, or "matrix"
to return each page of S
as a
diagonal matrix.
Examples
Input Arguments
Output Arguments
More About
Tips
Results obtained using
pagesvd
are numerically equivalent to computing the singular value decomposition of each of the same matrices in afor
-loop. However, the two results might differ slightly due to floating-point round-off error.
Extended Capabilities
Version History
Introduced in R2021b