The class name MATLAB for data of type float is "single".
In the MEX file you can write:
void mexFunction(int nlhs, mxArray * plhs[], int nrhs, const mxArray * prhs[]) {
Extracting it from an M file is pretty much like calling any other function. If you called the MEX function foo , you would call it like this:
>> x = foo;
Now x will contain a single precision value equivalent to single([1 2 3; 4 5 6]) , which was stored in plhs[0] .
source share