matlab internal problem and needs to close - reading from dll in MEX
Mostrar comentarios más antiguos
I am working a a project where I have to make a Matlab interface for IR tracking software. (www.free-track.net). FreeTrack provides a SDK in their download with Matlab code which makes a MEX file from C code. The C code reads from a dll called "freetrackClient.dll", which holds the tracking data. When I run FreeTrack and track my head movement, the data of my movement can be seen on the screen.
Now I want to read this data and save it into Matlab. However, when i run the funciton getData, Matlab crashes and says: "MATLAB has encountered a problem and needs to close"
?Why can't i read from the DLL?
2 comentarios
Ken Atwell
el 15 de Feb. de 2012
Are you using loadlibrary? Can you add a code fragment (i.e., the MATLAB code you are running that causes the crash)?
Ezra
el 15 de Feb. de 2012
Respuestas (1)
Ken Atwell
el 15 de Feb. de 2012
Double-check that you've initialized plhs[0] with mxCreateStructArray with at least the seven fields that you reference later one.
When in doubt, start with a working example and modify incrementally from there:
edit([matlabroot '/extern/examples/mx/mxcreatestructarray.c']);
1 comentario
Ezra
el 16 de Feb. de 2012
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!