MATLAB crashes while re-running compiled mex file.
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a cpp file which gets compiled successfully in Matlab and gives right results. But if I recall the function again, then Matlab crashes. There is no issue if I recompile it again and then run. I assume it is due to some error as mentioned in this post . Why does it work if I recompile it each time and does not work (Matlab crashes) in case of recalling the function in a loop? - How to get hold of the error?
3 comentarios
Michael Mathew
el 28 de Mayo de 2016
Editada: Walter Roberson
el 31 de Mayo de 2016
James Tursa
el 31 de Mayo de 2016
This is usually the result of a memory access violation caused by a coding error, but we would need to see your code. The reason it may work the first time but not subsequent times is that the first time corrupts memory but doesn't access the corrupted memory until the second time. Recompiling may clear out the corrupted memory before it gets accessed.
Respuestas (0)
Ver también
Categorías
Más información sobre Write C Functions Callable from MATLAB (MEX Files) 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!