recursive function causes matab to crash
1 次查看(过去 30 天)
显示 更早的评论
I increased the recursion using set parameter but the recursive function cause matlab to crash using different input parameters. All the variables are defined as global to reduce data duplication in memory. Can any body help me to solve this issue?
1 个评论
回答(1 个)
Steven Lord
2016-8-4
In earlier releases of MATLAB (I tried this in release R2014b) the error you received when you tried to perform recursion too many levels deep was:
Maximum recursion limit of 500 reached. Use set(0,'RecursionLimit',N) to
change the limit. Be aware that exceeding your available stack space can
crash MATLAB and/or your computer.
Sometime between then and now (release R2016a) it looks like we changed the message in at least some cases.
Out of memory. The likely cause is an infinite recursion within the program.
The best solution IMO is to avoid recursing that deeply. If you describe the problem you're trying to solve recursively, someone may be able to offer guidance on how to solve that using less recursion or no recursion at all.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrix Indexing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!