MATLAB: Mex “out of memory” problem

MATLABmex compiler

I'm hoping someone can help me with a problem I'm having with some mex code.
I am using a matlab toolbox and it has some mex function. When I call these c++ function, it crashes and matlab reports that it is "Out of Memory". I really need to fix this problem

Best Answer

Please read your question again. Then take the time to check, if it is possible in theory, that anybody can post a useful answer.
Afterwards show us the code, or debug your code to find the problem. Notice that Out-Of-Memory can mean, that installing more memory could potentially solve the problem.
Posting the complete error message is a good idea, when you want others to understand the problem. Perhaps there is any information about the location of the problem? A smart C++ function should catch such errors and show more details to allow to understand the reasons.
Contact the author and tell him the problem.