workspace of anonymized/memoized subfunctions and nested functions
4 次查看(过去 30 天)
显示 更早的评论
Dear all,
Is there any way to have control over the variables entering the workspace of an anonymous function? I have been experiencing some slowness lately and when I check the workspace of some of the anonymous or memoized functions I created, they contain more information that I want them to.
If the function refers to a subfunction, it contains all the information in the main function as well. Needless to say, it is the same for nested functions.
Any ideas?
0 个评论
采纳的回答
Matt J
2014-11-2
编辑:Matt J
2014-11-2
You can try the following tool
http://www.mathworks.com/matlabcentral/fileexchange/45749-clean-anonymous-functions-of-excess-memory
but read the disclaimers.
Anonymous/nested functions can only slow things down when you try to export handles to them from the workspace where they were created. Either you're returning the handle from a function, saving it to a .mat file, or sending it to a parfor worker.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Performance and Memory 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!