When I interrupt a script in the middle of a parfor, some files are still opened by Matlab (e.g. I cannot delete them). I usually call flcose('all')
to close all open files but it doesn't seem work in this case. What should I do?
问问题
259 次
1 回答
2
那是因为parfor
创建了一堆拥有自己文件句柄的 Matlab 从站。两个主要的解决方案是:
parfor i=1:12 % 12 or some number over your number of workers
fclose('all')
end
或者简单地使用matlabpool close
或 GUI(左下角)关闭并行池:
请注意,您可以使用Process Explorer来查找在 Windows 中打开文件的进程:
于 2014-06-15T17:11:00.550 回答