Clearing variables in function workspace effect on memory
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Octavian
el 6 de Abr. de 2015
Comentada: Stephen23
el 6 de Abr. de 2015
Dear All,
I have a script calling a function, with several large matrices present in this function's workspace. I would need to know if clearing residual matrices in the function workspace after function output was generated, prior to return to the base workspace, would help with the overall memory usage (increase free available memory for the remainder of the script) or whether returning to the script/base workspace after function completion clears function variables automatically. Is there a command to reveal memory blocked by a certain subfunction/function after the function was run, whos does not do it. This may be relevant as using clear all with function variables in the function workspace may be time costly.
Thank you,
Octavian
0 comentarios
Respuesta aceptada
James Tursa
el 6 de Abr. de 2015
Once a function returns, all "local" variables to that function are automatically cleared. You don't need to manually do it. See the "pack" and "memory" commands for more info:
1 comentario
Stephen23
el 6 de Abr. de 2015
And a few bits about the workspaces too:
Más respuestas (0)
Ver también
Categorías
Más información sobre Whos en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!