Mathc complexes/a276
Apparence
Le code de la fonction :
/* ------------------------------------ */
/* ------------------------------------ */
void p_Octave_mRZ(
double **A,
char name[],
int Pr
)
{
int r;
int c;
printf(" %s=[\n",name);
for(r=R1; r<A[R_SIZE][C0]; r++)
{
for(c=C1; c<A[C_SIZE][C0]; c+=C2)
printf("%+.*f,",Pr,A[r][c]);
if((r+1)<A[R_SIZE][C0]) printf("\b;\n");
else printf("\b]\n\n");
}
}
/* ------------------------------------ */
/* ------------------------------------ */
Attention on travaille ici sur des réels.
Pour que les matrices soient bien adapté au format octave, il vaut mieux que tous les nombres soit collés les un aux autres. On pourrait remplacer la virgule entre les nombres par un espace.
Installer et compiler ce fichier dans votre répertoire de travail.
c00a.c |
|---|
/* ------------------------------------ */
/* Save as : c00a.c */
/* ------------------------------------ */
#include "w_a.h"
/* ------------------------------------ */
#define RCA RC3
/* ------------------------------------ */
void fun(void)
{
double **A = r_mRZ(i_mZ(RCA,RCA),99.);
clrscrn();
printf(" Copy/Paste into the octave windows \n\n");
p_Octave_mRZ(A,"A",P0);
printf("format short e\n");
printf(" inv (A) \n\n");
f_mZ(A);
}
/* ------------------------------------ */
int main(void)
{
time_t t;
srand(time(&t));
do
{
fun();
} while(stop_w());
return 0;
}
/* ------------------------------------ */
/* ------------------------------------ */
Exemple de sortie écran :
--------------------------------
Copy/Paste into the octave windows
A=[
+18,-91,-16;
-93,-65,-90;
+45,-93,+55]
format short e
inv (A)
Press return to continue
Press X return to stop