I am using mxGetPr function to retrieve the data of an array of type double.
void mexFunction(int nlhs, mxArray *plhs, int nrhs, const mxArray *prhs)
#define FACES prhs
nFaces = mxGetM( FACES );
faces = mxGetPr( FACES );
for( int i=0; i<nFaces ; i++ )
mexPrintf("(%d): [ %d ]\n", i, faces[i] );
When I print the value of the first column of prhs, it's all zero while those of the input array is not zero and has different values. I checked with the documentation and many examples onlines and didn't see any difference between my code and theirs.
Could someone help me how to access the value of the elements of prhs correctly? I also checked the type of input array using whos command and it is double.