bonjour,
je voudrais convertir la valeur d´un pointeur double en entier.
je fais :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
void display( mxArray* in, int* tab, double* tabdoub)
{
      int i=0, j=0; /* loop index variables */
      int r=0, c=0; /* variables to store the row and column length of the matrix */
      int k=0;
      double *data; /* variable to point to the double data stored within the mxArray */
      
      r = mxGetM(in); //number of rows
      c = mxGetN(in); //number of columns


      data = mxGetPr(in); //Get real data elements in mxArray

      for( i = 0; i < r; i++ )
      {

           for( j = 0; j < c; j++)
              {
         
              k=10*i+j;
              tab[k] = (int)(data[i*c+j]+0.5);         
              tabdoub[k] = (double)(tab[k]);

              

              }
      }

}
mais lorsque je fais ca, j´ai un probleme qui intervient apres plusieurs utilisation de la fonction display. Alors je voudrais savoir si j´ai bien ecrit la conversion.