I am passing an integer array of uint8 type from MATLAB to a MEX-function. How do I read these values? I tried using:
int *n;
n = (int * ) mxGetData(prhs[0]);
but the values come out as junk. I also tried
double *n;
n= mxGetPr(prhs[0]);
and in this case junk values also appear.
What is the solution to this?
Basically I want to read the integer value in the MEX-function but mxGetPr
returns double type.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…