c - Dereference Pointer to MxArray -
I'm confused with some indicators:
I have some (numerical recipes) C function FITEXI (IN, AND OUT) that I As Max file, I would like to compile it to call from Mattelb. However, I can not get the gateway routine to reach pointer to outside so that it is near plhs [0] , how do I I can (at least in the sense of misleading error message) is:
Zero Max function (FNLHS, MXARE * PLHS [], int NRHS, CONST MXERE * PHS []) {Float * in; float out; In = (float *) mxgatedata (phh [0]); PLH [0] = Mxcreate enumeric matrix (1,1, Mxsingle_CLASS, MXRAL); Out = (float *) MX gedata (PLH [0]); Fitaceae (in, and out); Printf ("out =% lf", & amp; amp; out); / * Prints the correct result on the screen * /} An error message is found when compiling it:
Error: to type incompatible types While specifying for 'float' type 'float *' which is not very surprising for me, but very useful, I have mxGetData (plhs [0]) ,
Out = (float end) MXGetData (PLH [0]); That sounds like nonsense,
outside = (float) mxGetData (plhs [0]);
which fights with a variable and mxGetData (plhs [0]) an indicator
I already found and, but they both deal with casting instead of dereferencing.
I understand, but it does not help me, because I can not (i.e. not like) my c- regularly.
Any help is appreciated, thanks a lot!
why don 'do not you define outside to become just an indicator We do?
Float * out;
You can easily do this
outside = (float *) mxGetData (plhs [0]);
And you can use outside to write result values. If I am not mistaken about the fitexy () function, then you can call it from
fitexy (in, out);
.
Comments
Post a Comment