例题来自http://www.ams.org/samplings/feature-column/fcarc-svd,R命令如下: > M=matrix(nrow=25,ncol=15) > i=c(1:25) > j=c(1:15) > M[i,j]=1 > M[5<i&i<21,2<j&j<14]=0 > M[8<i&i<18,5<j&j<11]=1 > M
[,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14] [,15] [1,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [2,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [3,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [4,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [5,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [6,] 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 [7,] 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 [8,] 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 [9,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [10,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [11,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [12,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [13,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [14,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [15,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [16,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [17,] 1 1 0 0 0 1 1 1 1 1 0 0 0 1 1 [18,] 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 [19,] 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 [20,] 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 [21,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [22,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [23,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [24,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 [25,] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
$d( [1].988445e-16 2.175081e-16 1.363607e-17 [7] 4.475411e-33 2.248095e-33 1.175548e-48 8.279967e-50 1.075039e-50 3.287558e-66 [13] 2.043570e-67 2.017676e-82 4.561229e-99 $u( [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.25472672 -0.1835634 -0.03766653 9.385131e-01 9.072434e-02 1.047012e-01 [2,] -0.25472672 -0.1835634 -0.03766653 -1.374185e-01 8.285125e-01 -4.412292e-01 [3,] -0.25472672 -0.1835634 -0.03766653 -2.327228e-01 3.031237e-01 8.683065e-01 [4,] -0.25472672 -0.1835634 -0.03766653 -8.119597e-02 -1.746229e-01 -7.596835e-02 [5,] -0.25472672 -0.1835634 -0.03766653 -8.119597e-02 -1.746229e-01 -7.596835e-02 [6,] -0.08724631 0.1927167 -0.34916331 -7.552823e-17 -6.256185e-18 -2.307318e-18 [7,] -0.08724631 0.1927167 -0.34916331 -7.552823e-17 -6.256185e-18 -2.307318e-18 [8,] -0.08724631 0.1927167 -0.34916331 -7.552823e-17 -6.256185e-18 -2.307318e-18 [9,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [10,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [11,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [12,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [13,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [14,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [15,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [16,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [17,] -0.18423158 0.2211602 0.16810123 7.738493e-18 9.356326e-18 -1.965455e-17 [18,] -0.08724631 0.1927167 -0.34916331 -7.552823e-17 -6.256185e-18 -2.307318e-18 [19,] -0.08724631 0.1927167 -0.34916331 -7.552823e-17 -6.256185e-18 -2.307318e-18 [20,] -0.08724631 0.1927167 -0.34916331 -7.552823e-17 -6.256185e-18 -2.307318e-18 [21,] -0.25472672 -0.1835634 -0.03766653 -8.119597e-02 -1.746229e-01 -7.596835e-02 [22,] -0.25472672 -0.1835634 -0.03766653 -8.119597e-02 -1.746229e-01 -7.596835e-02 [23,] -0.25472672 -0.1835634 -0.03766653 -8.119597e-02 -1.746229e-01 -7.596835e-02 [24,] -0.25472672 -0.1835634 -0.03766653 -8.119597e-02 -1.746229e-01 -7.596835e-02 [25,] -0.25472672 -0.1835634 -0.03766653 -8.119597e-02 -1.746229e-01 -7.596835e-02 [,7] [,8] [,9] [,10] [,11] [,12] [1,] -1.392116e-17 7.081636e-17 -1.647428e-17 7.064888e-18 -2.200071e-17 1.617793e-17 [2,] 7.454063e-17 -4.884213e-17 4.649326e-17 -1.143158e-17 2.324083e-17 1.179520e-18 [3,] -2.689928e-16 2.018151e-16 -3.177451e-17 1.550157e-17 -1.581826e-17 -1.668603e-17 [4,] -4.930707e-01 7.835969e-01 1.059409e-15 -1.843229e-16 -2.352796e-17 1.434760e-17 [5,] -6.904585e-01 -6.167738e-01 -5.917373e-16 9.155859e-17 5.521462e-17 -1.313589e-17 [6,] -1.956399e-16 1.127437e-15 -8.964959e-01 1.719630e-01 -7.555410e-03 -2.693978e-17 [7,] 2.640475e-17 -1.493196e-16 1.064850e-02 -9.120192e-01 3.795923e-02 -2.701888e-17 [8,] 2.640475e-17 -2.880974e-16 2.210767e-01 2.210233e-01 8.576754e-01 -1.311172e-16 [9,] 1.214264e-18 -3.134689e-20 -7.401217e-17 -5.870810e-17 2.789748e-16 9.427870e-01 [10,] 1.214264e-18 -3.134689e-20 9.254558e-18 9.394756e-17 -2.633648e-17 -1.114464e-01 [11,] 1.214264e-18 -3.134689e-20 9.254558e-18 -3.196952e-18 -1.096032e-16 -1.187629e-01 [12,] 1.214264e-18 -3.134689e-20 9.254558e-18 -3.196952e-18 -2.633648e-17 -1.187629e-01 [13,] 1.214264e-18 -3.134689e-20 9.254558e-18 -3.196952e-18 -2.633648e-17 -1.187629e-01 [14,] 1.214264e-18 -3.134689e-20 9.254558e-18 -3.196952e-18 -2.633648e-17 -1.187629e-01 [15,] 1.214264e-18 -3.134689e-20 9.254558e-18 -3.196952e-18 -2.633648e-17 -1.187629e-01 [16,] 1.214264e-18 -3.134689e-20 9.254558e-18 -3.196952e-18 -2.633648e-17 -1.187629e-01 [17,] 1.214264e-18 -3.134689e-20 9.254558e-18 -3.196952e-18 -2.633648e-17 -1.187629e-01 [18,] 5.416032e-17 -2.325863e-16 2.215902e-01 1.730110e-01 -2.960264e-01 6.571854e-17 [19,] 5.416032e-17 -2.325863e-16 2.215902e-01 1.730110e-01 -2.960264e-01 6.571854e-17 [20,] 5.416032e-17 -2.325863e-16 2.215902e-01 1.730110e-01 -2.960264e-01 6.571854e-17 [21,] 2.367058e-01 -3.336463e-02 -8.813494e-17 1.790948e-17 -6.223254e-18 3.462696e-18 [22,] 2.367058e-01 -3.336463e-02 -8.813494e-17 1.790948e-17 -6.223254e-18 3.462696e-18 [23,] 2.367058e-01 -3.336463e-02 -8.813494e-17 1.790948e-17 -6.223254e-18 3.462696e-18 [24,] 2.367058e-01 -3.336463e-02 -8.813494e-17 1.790948e-17 -6.223254e-18 3.462696e-18 [25,] 2.367058e-01 -3.336463e-02 -8.813494e-17 1.790948e-17 -6.223254e-18 3.462696e-18 [,13] [,14] [,15] [1,] 3.074982e-17 -4.149903e-18 -3.430670e-18 [2,] -5.909184e-18 5.684175e-19 6.941969e-20 [3,] -2.517181e-17 3.954510e-18 3.746500e-18 [4,] 2.991872e-17 -4.602868e-18 -3.898811e-18 [5,] -3.583904e-17 5.905877e-18 4.656688e-18 [6,] 3.374816e-17 -1.651456e-18 3.993191e-18 [7,] -1.759426e-16 2.691802e-18 -3.450398e-19 [8,] 6.277363e-17 7.331432e-17 -7.436719e-18 [9,] -6.452582e-03 4.598098e-15 3.272005e-16 [10,] 9.361990e-01 4.193089e-14 3.387609e-15 [11,] -1.328209e-01 9.221466e-01 7.210739e-02 [12,] -1.328209e-01 -2.349311e-01 7.837296e-01 [13,] -1.328209e-01 -1.374431e-01 2.615699e-01 [14,] -1.328209e-01 -1.374431e-01 -2.793517e-01 [15,] -1.328209e-01 -1.374431e-01 -2.793517e-01 [16,] -1.328209e-01 -1.374431e-01 -2.793517e-01 [17,] -1.328209e-01 -1.374431e-01 -2.793517e-01 [18,] 3.197684e-17 -2.552673e-17 5.702234e-19 [19,] 3.197684e-17 -2.552673e-17 5.702234e-19 [20,] 3.197684e-17 -2.552673e-17 5.702234e-19 [21,] 6.593699e-18 -1.050630e-18 -8.918906e-19 [22,] 6.593699e-18 -1.050630e-18 -8.918906e-19 [23,] 6.593699e-18 -1.050630e-18 -8.918906e-19 [24,] 6.593699e-18 -1.050630e-18 -8.918906e-19 [25,] 6.593699e-18 -1.050630e-18 -8.918906e-19 $v [,1] [,2] [,3] [,4] [,5] [,6] [1,] -0.3211592 0.25133260 -0.2892900 3.279339e-01 6.048180e-01 5.259796e-01 [2,] -0.3211592 0.25133260 -0.2892900 5.678292e-01 -1.727842e-01 -6.306470e-01 [3,] -0.1729981 -0.35188171 -0.1136556 -3.750929e-01 6.525681e-01 -5.165206e-01 [4,] -0.1729981 -0.35188171 -0.1136556 7.501857e-02 -1.305136e-01 1.033041e-01 [5,] -0.1729981 -0.35188171 -0.1136556 7.501857e-02 -1.305136e-01 1.033041e-01 [6,] -0.2856071 0.02967574 0.3428526 1.129603e-17 -7.557567e-17 2.484178e-17 [7,] -0.2856071 0.02967574 0.3428526 -4.421512e-17 -2.006452e-17 -3.066937e-17 [8,] -0.2856071 0.02967574 0.3428526 -4.421512e-17 -2.006452e-17 -3.066937e-17 [9,] -0.2856071 0.02967574 0.3428526 -4.421512e-17 -2.006452e-17 -3.066937e-17 [10,] -0.2856071 0.02967574 0.3428526 -4.421512e-17 -2.006452e-17 -3.066937e-17 [11,] -0.1729981 -0.35188171 -0.1136556 7.501857e-02 -1.305136e-01 1.033041e-01 [12,] -0.1729981 -0.35188171 -0.1136556 7.501857e-02 -1.305136e-01 1.033041e-01 [13,] -0.1729981 -0.35188171 -0.1136556 7.501857e-02 -1.305136e-01 1.033041e-01 [14,] -0.3211592 0.25133260 -0.2892900 -4.478816e-01 -2.160169e-01 5.233370e-02 [15,] -0.3211592 0.25133260 -0.2892900 -4.478816e-01 -2.160169e-01 5.233370e-02 [,7] [,8] [,9] [,10] [,11] [,12] [1,] 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 0.000000e+00 [2,] -3.830207e-16 1.493710e-16 -1.660393e-16 1.106949e-17 -1.826910e-17 -1.368596e-17 [3,] -2.608819e-16 8.760320e-17 -1.090414e-16 3.400836e-19 -1.367560e-17 -4.424844e-17 [4,] -7.394000e-01 4.497420e-01 -2.253432e-01 1.544356e-02 1.287471e-03 9.892792e-17 [5,] -2.689659e-01 -5.666634e-01 6.361102e-01 -4.359486e-02 -3.634338e-03 -1.441614e-16 [6,] 1.833270e-01 6.145358e-01 6.220185e-01 -4.262911e-02 -3.553826e-03 -1.149237e-16 [7,] -4.583175e-02 -1.536340e-01 -2.149120e-01 -8.488838e-01 -8.663199e-02 -3.084697e-16 [8,] -4.583175e-02 -1.536340e-01 -1.346796e-01 3.798109e-01 -7.822411e-01 -1.298277e-15 [9,] -4.583175e-02 -1.536340e-01 -1.362135e-01 2.558510e-01 4.362135e-01 7.005581e-01 [10,] -4.583175e-02 -1.536340e-01 -1.362135e-01 2.558510e-01 4.362135e-01 -7.005581e-01 [11,] 3.361220e-01 3.897381e-02 -1.369223e-01 9.383766e-03 7.822889e-04 1.108656e-01 [12,] 3.361220e-01 3.897381e-02 -1.369223e-01 9.383766e-03 7.822889e-04 -5.543282e-02 [13,] 3.361220e-01 3.897381e-02 -1.369223e-01 9.383766e-03 7.822889e-04 -5.543282e-02 [14,] 7.310841e-17 -7.540135e-17 7.249116e-17 -2.045672e-18 3.071467e-18 8.183689e-18 [15,] 7.310841e-17 -7.540135e-17 7.249116e-17 -2.045672e-18 3.071467e-18 8.183689e-18 [,13] [,14] [,15] [1,] 0.000000e+00 0.000000e+00 0.000000e+00 [2,] -7.240902e-18 -2.335869e-18 -1.672717e-17 [3,] -2.323143e-17 -2.691346e-18 1.981128e-17 [4,] 2.471213e-18 1.870339e-17 -7.462910e-18 [5,] 4.597650e-18 -4.691236e-18 9.867867e-18 [6,] 7.391062e-18 1.830775e-17 -1.364594e-17 [7,] 4.719322e-17 -3.035606e-18 1.699655e-17 [8,] 1.031236e-16 5.382008e-17 -3.150506e-17 [9,] -9.601246e-02 1.603995e-16 2.889875e-17 [10,] 9.601246e-02 -2.350829e-16 -1.147753e-17 [11,] 8.089348e-01 -7.976948e-16 1.490246e-17 [12,] -4.044674e-01 7.071068e-01 -1.115211e-17 [13,] -4.044674e-01 -7.071068e-01 -4.331377e-17 [14,] -4.592221e-18 -5.732842e-17 7.071068e-01 [15,] -4.592221e-18 5.369388e-17 -7.071068e-01