Prev: sum without transposing
Next: Problem with nlinfit
From: Rafael Valenzuela on 4 May 2010 07:45 Hi : I'm trying to call imread with mexCallMATLAB but I always get the same error that can be ? . error: argument of type "double" is incompatible with parameter of type "mxArray **" The code is this <code> double imag; mxArray *str = mxCreateString("letras.tif"); mexCallMATLAB(1, &str, 1,imag, "imread"); printf("%f \n",imag); </code>
From: Steven Lord on 4 May 2010 09:29 "Rafael Valenzuela" <ravamo(a)gmail.com> wrote in message news:hrp1c3$lif$1(a)fred.mathworks.com... > Hi : > I'm trying to call imread with mexCallMATLAB but I always get the same > error that can be ? . > error: argument of type "double" is incompatible with parameter of type > "mxArray **" That's correct. What's the signature that mexCallMATLAB expects? http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/mexcallmatlab.html Your fourth input argument is not of the correct type. Look at the mexcallmatlab.c example file (the first file listed in the Examples section on that page) for an example of how to call mexCallMATLAB with inputs of the correct type. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: Rafael Valenzuela on 4 May 2010 15:35 Thanks Seteven: I've solved, I used a mxArray but this makes me take another question as you can move from a mxArray to double "Steven Lord" <slord(a)mathworks.com> wrote in message <hrp7gd$am4$1(a)fred.mathworks.com>... > > "Rafael Valenzuela" <ravamo(a)gmail.com> wrote in message > news:hrp1c3$lif$1(a)fred.mathworks.com... > > Hi : > > I'm trying to call imread with mexCallMATLAB but I always get the same > > error that can be ? . > > error: argument of type "double" is incompatible with parameter of type > > "mxArray **" > > That's correct. What's the signature that mexCallMATLAB expects? > > http://www.mathworks.com/access/helpdesk/help/techdoc/apiref/mexcallmatlab.html > > Your fourth input argument is not of the correct type. Look at the > mexcallmatlab.c example file (the first file listed in the Examples section > on that page) for an example of how to call mexCallMATLAB with inputs of the > correct type. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ >
From: Steven Lord on 5 May 2010 14:46 "Rafael Valenzuela" <ravamo(a)gmail.com> wrote in message news:hrpstn$9hh$1(a)fred.mathworks.com... > Thanks Seteven: > > I've solved, I used a mxArray but this makes me take another question as > you can move from a mxArray to double Look at mxGetPr and/or mxGetData. -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: Rafael Valenzuela on 5 May 2010 15:28
"Steven Lord" <slord(a)mathworks.com> wrote in message <hrsee5$a0k$1(a)fred.mathworks.com>... > > "Rafael Valenzuela" <ravamo(a)gmail.com> wrote in message > news:hrpstn$9hh$1(a)fred.mathworks.com... > > Thanks Seteven: > > > > I've solved, I used a mxArray but this makes me take another question as > > you can move from a mxArray to double > > Look at mxGetPr and/or mxGetData. > > -- > Steve Lord > slord(a)mathworks.com > comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ > the same problem error using mxGetData : error: a value of type "void *" cannot be assigned to an entity of type "double" error using mxGetPr : error: a value of type "double *" cannot be assigned to an entity of type "double" this is a code |