MATLAB: Matlab crashes while running *.mexw32

matlab crashes while running *.mexw32

Matlab crashes while running *.mexw32 file. This file is generated from a .cpp code. The Matlab runs fine when the output data size is less, but it crashes for higher data size output.

Best Answer

This means, that the CPP-function has a serious bug.
[EDITED, reply to comment "get rid of the problem of running out of memory]:
  1. Install more memory.
  2. Reduce the memory consumption of your program.
  3. Check all created arrays for NULL. Never never never omit such checks. They cost micro-seconds of runtime and seconds to be typed in, but they save hours of tedious debugging and not reproducible crashs.