Mathc matrices/h05c

Un livre de Wikilivres.


Bibliothèque


Installer ce fichier dans votre répertoire de travail.

vpoctave.h
/* ------------------------------------ */
/*  Save as :   vpoctave.h                   */
/* ------------------------------------ */ 
void p_Octave_mR(
double  **A,
char name[],
int      Pn
)
{
 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++)
     printf("%+.*f,",Pn,A[r][c]);

   if((r+1)<A[R_SIZE][C0]) printf("\b;\n");
   else                    printf("\b]\n\n");
  }
}
/* ------------------------------------ */   
/* ------------------------------------ */ 
/* ------------------------------------ */ 
void pE_Octave_mR(
double  **A,
char name[],
int      Pn
)
{
 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++)
     printf("%+.*e,",Pn,A[r][c]);

   if((r+1)<A[R_SIZE][C0]) printf("\b;\n");
   else                    printf("\b]\n\n");
  }
}
/* ------------------------------------ */
/* ------------------------------------ */ 
void pAi_Octave_mR(
double  **A,
char name[],
int       i,
int       Pn
)
{
 int r;
 int c;

 printf(" %s%d=[\n",name,i);

 for(r=R1; r<A[R_SIZE][C0];    r++)
  {
   for (c=C1; c<A[C_SIZE][C0]; c++)
     printf("%+.*f,",Pn,A[r][c]);

   if((r+1)<A[R_SIZE][C0]) printf("\b;\n");
   else                    printf("\b]\n\n");
  }
}
/* ------------------------------------ */   
/* ------------------------------------ */

Une matrice pour octave.

La fonction pAi_Octave_mR(); permet d'introduire un index (0,1,...) lorsque l'on travaille avec des tableaux de matrices.