matlab internal problem and needs to close - reading from dll in MEX
Ältere Kommentare anzeigen
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 Kommentare
Ken Atwell
am 15 Feb. 2012
Are you using loadlibrary? Can you add a code fragment (i.e., the MATLAB code you are running that causes the crash)?
Ezra
am 15 Feb. 2012
Antworten (1)
Ken Atwell
am 15 Feb. 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 Kommentar
Ezra
am 16 Feb. 2012
Kategorien
Mehr zu Write C Functions Callable from MATLAB (MEX Files) finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!