onCleanup and script
Mostrar comentarios más antiguos
Hello.
I'm using a parfor loop,but sometimes I stop its execution with ctrl+c, so I would like to execute the command "matlabpool close" immediately in order not to leave the processes on. I have recommended to use onCleanup function,but I have read that I need to use it within a function and not in a script, and I've got a script, owe to that fact I wonder if I could do the same with a try/catch sentence, is it possible?
thanks!
Respuesta aceptada
Más respuestas (1)
Javier
el 27 de Jul. de 2011
0 votos
1 comentario
Walter Roberson
el 27 de Jul. de 2011
onCleanup() should go just after you have created the conditions that need to be cleaned up later -- e.g., just after you have opened the pool.
Categorías
Más información sobre Scope Variables and Generate Names en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!