User`s guide

Using C/C++ Shared Libraries on M ac OS X
* mclTerminateApplica tion terminates the entire
* application and exits with the exit code set using
* mclSetExitCode. Note that this behavior is only on MAC
* platform.
*/
#ifdef __APPLE_CC__
mclSetExitCode(*err);
#endif
mclTerminateApplication();
return 0;
}
/*DISPLAY This function will display the double matrix stored
* in an mxArray. This function assumes that the mxArray passed
* as input contains double array.
*/
void display(const mxArray* in)
{
int i=0, j=0; /* loop index variables */
int r=0, c=0; /* variables to store the row and col umn len gth
* of the matrix */
double *data; /* variable to point to the double data stored
* within the mxArray */
/* Get the size of th e matri x */
r = mxGetM(in);
c = mxGetN(in);
/* Get a pointer to t he doub le data in mxArray */
data = mxGetPr(in);
/* Loop through the data and display same in matrix format */
for(i=0;i<c;i++){
for( j = 0; j < r; j++){
printf("%4.2f\t",data[j*c+i]);
}
printf("\n");
}
printf("\n");
}
7-35