I create various matlab.m files using python and then run them using a subprocess. When the files are finished, I would like to delete them:
command = ['C:\\MatlabR2012b\\bin\\matlab.exe', '-nodesktop', '-nosplash', '-r', 'mfile']
matlab = subprocess.Popen(command)
matlab.wait()
print "delete"
os.remove(self.filename)
The problem is that matlab.wait () never waits, since matlab immediately returns a return code of 0. Is there any other way to check if Matlab is complete?
source
share