Mex file from multiple sources
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have two C codes. First one is the main code and the second one is for the initial arrangements, the calling of the main code and printing of the results. I want to convert this to mex file and access it from MATLAB. How should I convert them so that I can access to both functions?
Thanks.
0 comentarios
Respuestas (1)
Jan
el 23 de Feb. de 2017
You can compile them together:
mex -O main.c printing.c
Then you can access the main function only. Either you include a wrapper in the mexFunction(), which forward calls to the subfunctions e.g. triggered by the first input. Or you compile two functions:
mex -O main.c
mex -O printing.c
Then you can call the printing lib directly from Matlab or through mexCallMATLAB from the main.mex function. There is an undocumented function mexRunMexFile also, but I'd hesitate to use it.
0 comentarios
Ver también
Categorías
Más información sobre MATLAB Compiler en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!