MATLAB crashes while re-running compiled mex file.
이전 댓글 표시
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
Image Analyst
2016년 5월 28일
What does "I recall the function" mean? How are you calling it? What changes did your program make so that the second time the max file is called it can't work? Perhaps a needed data file got deleted??? Who knows?
Michael Mathew
2016년 5월 28일
편집: Walter Roberson
2016년 5월 31일
James Tursa
2016년 5월 31일
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.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!