< Mathc matrices
Installer et compiler ces fichiers dans votre répertoire de travail.
![]() |
c0a5.c ' |
---|
/* ------------------------------------ */
/* Save as : c0a5.c */
/* ------------------------------------ */
#include "v_a.h"
/* ------------------------------------ */
void fun(void)
{
double ab[R5*C5]={
-71,-749,+252,-233,+682,
-749,-151,+446,+704,+214,
+252,+446,+476,+84,-955,
-233,+704,+84,-333,-593,
+682,+214,-955,-593,-365
};
int r = RC5;
double **A = ca_A_mR(ab,i_mR(r,r));
double **EignVector= i_mR(r,r);
double **EigsValue = i_mR(r,C1);
clrscrn();
printf(" Copy/Past into the octave windows \n\n");
p_octave_mR(A,"a",S1,P0);
printf(" [V, E] = eigs (a,10) \n\n");
stop();
clrscrn();
eignVectoruv_mR(A,EignVector);
printf(" EignVector:");
p_mR(EignVector,S5,P6,C6);
eigsuv_mR(A,EigsValue);
printf(" EigsValue :");
p_mR(EigsValue,S13,P6,C1);
stop();
f_mR(A);
f_mR(EignVector);
f_mR(EigsValue);
}
/* ------------------------------------ */
int main(void)
{
fun();
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Déclaration des fichiers h.
Exemple de sortie écran :
/* ------------------------------------ */
Copy/Past into the octave windows
a=[
-71,-749,+252,-233,+682;
-749,-151,+446,+704,+214;
+252,+446,+476,+84,-955;
-233,+704,+84,-333,-593;
+682,+214,-955,-593,-365]
[V, E] = eigs (a,10)
Press return to continue.
/* ------------------------------------ */
EignVector:
-0.413755 +0.367788 +0.546493 +0.460165 +0.427940
-0.474083 -0.410486 -0.409077 -0.200072 +0.631961
+0.355379 -0.559031 +0.659732 -0.250726 +0.251159
+0.351165 -0.381920 -0.247315 +0.810636 +0.111910
+0.595350 +0.487704 -0.193884 -0.168001 +0.584712
EigsValue :
-1929.227703
+1528.237677
+657.365585
-542.101300
-158.274261
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.