Hi I want to send a value from my matlab to my mex function. The value is generally about 10 digits long and i have used unsigned long long data type.
But i have difficulty accessing it from the mexfile.
mxGetPr returns double type, so is there some type conversion i have to do?
Yes, I just encountered this. You shouldn’t use
mxGetPranymore in general. The better way to do it is to first check the type like this:Then access the data through
(double *)mxGetData(prhs[0])or in your case(unsigned long long int*)mxGetData(prhs[0])You can look up
mxIsClassandmxGetDatafor more info.Edit: Also here’s a list of the different types for
mxIsClass