1

I'm developing a Matlab application that works fine uncompiled, but when I compiled it and tried running the executable, got this error :

Out of memory. The likely cause is an infinite recursion within the program. Error in set (line 15) MATLAB:lang:StackOverflow

... which is unhelpful in that it doesn't say which function falls into an infinite recursion. Is there a way to find whee the recursion is happening?

2
  • Code should not be running differently when compiled. Are you using the same inputs to the code? I think the only way of debugging a compiled MATLAB program is to add print statements, unfortunately. Commented Jun 25, 2020 at 12:52
  • There is no debugging in the compiled executable, which is why you have this frustrating error messages. Somewhere a variable seems to exceed its limits (stackoverflow -- kind of ironic^^). Either add print statements or comment prat of the function out to narrow down the problem Commented Jun 26, 2020 at 5:42

1 Answer 1

0

Thanks Cris Luengo and max for the comments. My application uses parts of the GUI Layout Toolbox, but the compiler does not look into toolbox folders to find dependencies (don't know why), so I had to add the folder manually. Turns out that the GUI toolbox has a folder with the same name as a folder in my application - that is what caused the recursion. After renaming things to avoid this duplication and recompiling, the error disappeared and the packaged application runs fine.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.