MATLAB stürzt ab, wenn es mxSetPr in einer mex-Datei erreicht
Ich schreibe eine Funktion innerhalb einesmex
Datei, die ein @ aufruMATLAB
Funktion. Leider, wenn es um @ gemxSetPr
, MATLAB
stürzt ab und geht nicht weiter. Könnte mir bitte jemand sagen, wie ich das beheben kann?
void myconv2( double * Ain , double *Aout,
int AnRows , int AnCols,
double* kernel, int kernelnRows, int kernelnCols )
{
mxArray *rhs[3], *lhs[1];
rhs[0] = mxCreateNumericMatrix( 0, 0, mxDOUBLE_CLASS, mxREAL );
rhs[1] = mxCreateNumericMatrix( 0, 0, mxDOUBLE_CLASS, mxREAL );
rhs[2] = mxCreateString ( "same" );
mxSetPr( rhs[0], Ain );
mxSetM ( rhs[0], AnRows );
mxSetN ( rhs[0], AnCols );
mxSetPr( rhs[1], kernel );
mxSetM ( rhs[1], kernelnRows );
mxSetN ( rhs[1], kernelnCols );
mexCallMATLAB(1, lhs, 3, rhs, "conv2");
Aout = mxGetPr( lhs[0] );
}