MATLAB crashes while re-running compiled mex file.
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
James Tursa
le 31 Mai 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.
Réponses (0)
Voir également
Catégories
En savoir plus sur Write C Functions Callable from MATLAB (MEX Files) dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!