MIT_MatlabToolbox/trunk/utils/VisionPrePostProcessor/main_offboard_image.c
//allocates storage for matrix of size nx * ny
allocates storage for matrix of size nx * ny
allocates storage for matrix of size nx * ny
void alloc_matrix
     (float ***matrix,  
      long  nx,         
      long  ny)         
{
long i;
*matrix = (float **) malloc (nx * sizeof(float *));
if (*matrix == NULL)
   {
   printf("alloc_matrix: not enough storage available\n");
   exit(1);
   }
for (i=0; i<nx; i++)
    {
    (*matrix)[i] = (float *) malloc (ny * sizeof(float));
    if ((*matrix)[i] == NULL)
       {
       printf("alloc_matrix: not enough storage available\n");
       exit(1);
       }
    }
return;
}
void alloc_matrix ( float * * * matrix , long nx , long ny ) { long i ; * matrix = ( float * * ) malloc ( nx * sizeof ( float * ) ) ; if ( * matrix == NULL ) { printf ( " \n " ) ; exit ( 1 ) ; } for ( i = 0 ; i < nx ; i ++ ) { ( * matrix ) [ i ] = ( float * ) malloc ( ny * sizeof ( float ) ) ; if ( ( * matrix ) [ i ] == NULL ) { printf ( " \n " ) ; exit ( 1 ) ; } } return ; }
allocates storage for matrix of size nx * ny
allocates storage for matrix of size nx * ny
/* matrix */ /* size in x-direction */ /* size in y-direction */