I am performing a matlab calculation through python. For this purpose, I use the following command:
retcode=subprocess.call["matlab","-nosplash","nodesktop","-wait","-r","run('matlabscript.m')","quit;"])
by running this command line in python, a matlab session opens and I can start to execute the aforementioned script 'matlabscript.m'
. Is there a way to get the output of the execution of this script into python? retcode, does not contain anything unless a single number. I have tried to use subprocess.check_output instead, but I cannot get anything. Basically, when I execute the aforementioned sript a casename is going to be created and specified.
You could use
subprocess.check_output
which will wait for the result: