Is it allowed for a function to have return type of mxArray?
Mostrar comentarios más antiguos
This is a very "noob" question probably, but is it allowed to have a function with return type mxArray? Or can I only return a pointer to mxArray?
e.g.
mxArray callEarthRotationCorrection(double traveltime, double *pX) {
mxArray output;
// Do some stuff to output
return output;
}
Currently, I'm getting a compile error at my function definition:
error: return type is an incomplete type
But it's possible that the error is related to something else I'm doing wrong in the function...
Respuesta aceptada
Más respuestas (1)
Jan
el 20 de Jun. de 2013
You cannot simply define an mxArray by mxArray output, because the mxArray needs to be created with defining a type and a dimension, e.g. by mxCreateNumericalArray etc. Therefore output must be a pointer:
mxArray *callEarthRotationCorrection(double traveltime, double *pX) {
mxArray *output;
// Do some stuff to output
return output;
}
1 comentario
Robert
el 26 de Jun. de 2013
Categorías
Más información sobre MATLAB Compiler en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!