onCleanup and script
이전 댓글 표시
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!
채택된 답변
추가 답변 (1개)
Javier
2011년 7월 27일
0 개 추천
댓글 수: 1
Walter Roberson
2011년 7월 27일
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.
카테고리
도움말 센터 및 File Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!