Description
Decomposes any n x m matrix A such that A = U*S*V.Transpose() where U is an n x n unitary matrix, V is an m x m unitary matrix, and S is an n x m matrix with the singular values of A on the main diagonal.
Timing Precision Mode
This page describes functionality in nanosecond timing precision mode.
Click here to see the documentation for this object in millisecond timing precision mode.
Method Signature
Arguments
U
|
|
Description:
|
The matrix containing the left singular vectors of matrix A.
|
S
|
|
Description:
|
The matrix containing the singular values of matrix A.
|
V
|
|
Description:
|
The matrix containing the right singular vectors of matrix A.
|
Syntax
myMatrix1.SingularValueDecomposition(myMatrix2, myMatrix3, myMatrix4);
|
This example shows how to calculate the Singular Value decomposition of a Matrix m such that m = U*S*V.Transpose().
Matrix m;
Matrix U;///NxN Unitary Matrix
Matrix S;///NxM Matrix with the Singular Values of m on the main diagonal
Matrix V;///MxM Unitary Matrix
m = [ 7.031811867, -12.068033280, -0.242324713;
6.130012135, -2.521814010, 0.220281139;
-21.150124870, 39.663068619, -6.106767271 ];
m.SingularValueDecomposition(U, S, V);
Report U, S, V;
|
Output report:
U = -0.289992512 0.165757695 -0.942564974
-0.108022447 0.972923426 0.204331001
0.950912979 0.161072635 -0.264234956
S = 47.695894740 0.000000000 0.000000000
0.000000000 4.272992482 0.000000000
0.000000000 0.000000000 1.936544880
V = -0.478306992 0.871263642 0.110100352
0.869847998 0.452781903 0.195839242
-0.120776164 -0.189441850 0.974435685
|
|
See also
Matrix Object
Matrix, Array, and Variable Math Guide
|