Difference between revisions of "ApCoCoA-1:Num.SVD"

From ApCoCoAWiki
(Updated example. Use Dec to display result.)
Line 20: Line 20:
 
-------------------------------
 
-------------------------------
 
[Mat([
 
[Mat([
   [<quote>-0.473</quote>, <quote>-0.666</quote>, <quote>-0.575</quote>],
+
   [<quotes>-0.473</quotes>, <quotes>-0.666</quotes>, <quotes>-0.575</quotes>],
   [<quote>-0.415</quote>, <quote>-0.407</quote>, <quote>0.813</quote>],
+
   [<quotes>-0.415</quotes>, <quotes>-0.407</quotes>, <quotes>0.813</quotes>],
   [<quote>-0.776</quote>, <quote>0.624</quote>, <quote>-0.084</quote>]
+
   [<quotes>-0.776</quotes>, <quotes>0.624</quotes>, <quotes>-0.084</quotes>]
 
]), Mat([
 
]), Mat([
   [<quote>33.091</quote>, <quote>17.047</quote>, <quote>3.365</quote>]
+
   [<quotes>33.091</quotes>, <quotes>17.047</quotes>, <quotes>3.365</quotes>]
 
]), Mat([
 
]), Mat([
   [<quote>-0.579</quote>, <quote>-0.266</quote>, <quote>-0.424</quote>, <quote>-0.642</quote>],
+
   [<quotes>-0.579</quotes>, <quotes>-0.266</quotes>, <quotes>-0.424</quotes>, <quotes>-0.642</quotes>],
   [<quote>0.755</quote>, <quote>0.119</quote>, <quote>-0.159</quote>, <quote>-0.624</quote>],
+
   [<quotes>0.755</quotes>, <quotes>0.119</quotes>, <quotes>-0.159</quotes>, <quotes>-0.624</quotes>],
   [<quote>-0.265</quote>, <quote>0.423</quote>, <quote>0.750</quote>, <quote>-0.431</quote>],
+
   [<quotes>-0.265</quotes>, <quotes>0.423</quotes>, <quotes>0.750</quotes>, <quotes>-0.431</quotes>],
   [<quote>-0.153</quote>, <quote>0.857</quote>, <quote>-0.480</quote>, <quote>0.100</quote>]
+
   [<quotes>-0.153</quotes>, <quotes>0.857</quotes>, <quotes>-0.480</quotes>, <quotes>0.100</quotes>]
 
])]
 
])]
 
-------------------------------
 
-------------------------------

Revision as of 08:15, 7 July 2009

Num.SVD

Computes the singular value decomposition of a matrix.

Syntax

Num.SVD(A:MAT):[U:MAT,S:MAT,VT:MAT]

Description

Please note: The function(s) explained on this page is/are using the ApCoCoAServer. You will have to start the ApCoCoAServer in order to use it/them.

  • @param A The matrix we want to decompose.

  • @return This function returns a list of three matrices which form the singular value decomposition of the input matrix. The list produced is [U, S, VT].

Example

D:=[[1,2,7,18],[2,4,9,12],[23,8,9,10]];
Dec(Num.SVD(D),3);

-- CoCoAServer: computing Cpu Time = 0
-------------------------------
[Mat([
  [<quotes>-0.473</quotes>, <quotes>-0.666</quotes>, <quotes>-0.575</quotes>],
  [<quotes>-0.415</quotes>, <quotes>-0.407</quotes>, <quotes>0.813</quotes>],
  [<quotes>-0.776</quotes>, <quotes>0.624</quotes>, <quotes>-0.084</quotes>]
]), Mat([
  [<quotes>33.091</quotes>, <quotes>17.047</quotes>, <quotes>3.365</quotes>]
]), Mat([
  [<quotes>-0.579</quotes>, <quotes>-0.266</quotes>, <quotes>-0.424</quotes>, <quotes>-0.642</quotes>],
  [<quotes>0.755</quotes>, <quotes>0.119</quotes>, <quotes>-0.159</quotes>, <quotes>-0.624</quotes>],
  [<quotes>-0.265</quotes>, <quotes>0.423</quotes>, <quotes>0.750</quotes>, <quotes>-0.431</quotes>],
  [<quotes>-0.153</quotes>, <quotes>0.857</quotes>, <quotes>-0.480</quotes>, <quotes>0.100</quotes>]
])]
-------------------------------

See also

Introduction to CoCoAServer

Num.QR

Num.EigenValues

Num.EigenValuesAndVectors

Num.EigenValuesAndAllVectors