< Mathc matrices
Installer ce fichier dans votre répertoire de travail.
![]() |
ca67.c ' |
---|
/* ------------------------------------ */
/* Save as : ca67.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
/* ------------------------------------ */
void fun(void)
{
double ab[R6*C7]={
-43,-25,-83,+76,+56,-35,-39,
+10,+62,-43,-97,+32,+98,-3,
+72,-75,-63,-55,+44,-57,-5,
+2,-59,-71,+82,+6,-83,+36,
+6,+18,+38,+46,+42,-21,-23,
+98,-55,-59,+6,-17,+2,-3
};
int r = R6;
int c = C7;
double **A = ca_A_mR(ab,i_mR(r,c));
double **A_T = i_mR(c,r);
double **SvdValue = i_mR(r,C1);
double **svdU = i_mR(r,r);
double **svdV = i_mR(c,c);
clrscrn();
printf(" Copy/Past into the octave windows \n\n\n");
p_octave_mR(A,"a",1,0);
printf(" [U, S, V] =svd (a,10)\n\n\n");
stop();
clrscrn();
svdU_mR(A,svdU);
svdV_mR(A,svdV);
svduv_mR(transpose_mR(A,A_T),SvdValue);
printf(" svdU :");
p_mR(svdU,S10,P6,C6);
printf(" SvdValue :");
p_mR(SvdValue,S10,P6,C6);
printf(" svdV :");
p_mR(svdV,S10,P6,C6);
stop();
f_mR(A);
f_mR(A_T);
f_mR(SvdValue);
f_mR(svdU);
f_mR(svdV);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
------------------------------------
Copy/Past into the octave windows
a=[
-43,-25,-83,+76,+56,-35,-39;
+10,+62,-43,-97,+32,+98,-3;
+72,-75,-63,-55,+44,-57,-5;
+2,-59,-71,+82,+6,-83,+36;
+6,+18,+38,+46,+42,-21,-23;
+98,-55,-59,+6,-17,+2,-3]
[U, S, V] =svd (a,10)
Press return to continue.
------------------------------------
svdU :
+0.439834 -0.157111 +0.767414 +0.024618 +0.155471 -0.410073
-0.474086 +0.479566 +0.591984 -0.142479 +0.026043 +0.416935
+0.346069 +0.642856 -0.045811 +0.578471 -0.355706 -0.060975
+0.621683 -0.074095 +0.031044 -0.374162 -0.250547 +0.635835
+0.065876 -0.253041 +0.041423 +0.630092 +0.542385 +0.488587
+0.266824 +0.512395 -0.236330 -0.327798 +0.701191 -0.106231
SvdValue :
+235.873078
+181.096337
+124.257466
+80.458407
+68.433454
+37.648335
svdV :
+0.123162 +0.587452 +0.428361 +0.125215 +0.576242 +0.297618
-0.493966 -0.236991 -0.264496 -0.017256 +0.151761 +0.472741
-0.404038 -0.456482 +0.587097 +0.465939 +0.079124 -0.009591
+0.491744 -0.598890 -0.051939 -0.245943 +0.547474 +0.151971
+0.112976 +0.083108 -0.529921 +0.647086 +0.047423 +0.367521
-0.568229 +0.156503 -0.240202 -0.380688 +0.411986 -0.121104
+0.011037 +0.017061 +0.246281 -0.377880 -0.408588 +0.717645
+0.141168
+0.618920
-0.245446
-0.116229
-0.378778
-0.515367
-0.337907
Press return to continue.
Cet article est issu de Wikibooks. Le texte est sous licence Creative Commons - Attribution - Partage dans les Mêmes. Des conditions supplémentaires peuvent s'appliquer aux fichiers multimédias.