clearing memory during function runing
2 次查看(过去 30 天)
显示 更早的评论
Hi, im runing a function that uses a lot of memory and sometimes the function stops because there is not enough memory. is it possible to clear variables during running in order to free some memory?
thank you
0 个评论
回答(2 个)
Walter Roberson
2013-11-20
You can clear variables in the current function's workspace, or in the base workspace, or global variables.
4 个评论
Laurent
2013-11-20
But PACK cannot be used from within a function, so it will not solve memory problems during running of the function.
Walter Roberson
2013-11-20
Correct. But sometimes it makes sense to "checkpoint" your current state, return back up some levels, clean up memory, and then restart from the checkpoint.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!