16 lines
335 B
Text
16 lines
335 B
Text
|
|
(* Define the matrix *)
|
||
|
|
matrix = {{3, 0}, {4, 5}};
|
||
|
|
|
||
|
|
(* Perform singular value decomposition *)
|
||
|
|
{u, s, v} = SingularValueDecomposition[matrix];
|
||
|
|
|
||
|
|
(* Display results with 10 decimal places *)
|
||
|
|
Print["U matrix:"]
|
||
|
|
N[u, {Infinity, 10}] //Print
|
||
|
|
|
||
|
|
Print["S matrix:"]
|
||
|
|
N[s, {Infinity, 10}] //Print
|
||
|
|
|
||
|
|
Print["V matrix:"]
|
||
|
|
N[v, {Infinity, 10}] //Print
|