Skip to content Skip to sidebar Skip to footer

Returning Gracefully From Matlab Back To Python

I call Matlab code from python as matlab_cmd_string = MatlabExePth+ ' -nosplash -nodesktop -wait -logfile FileIoReg_MatlabRemoteRun.log -minimize -r ' fname = 'CompareMse ' mat_cmd

Solution 1:

Try to use subprocess.check_output(*popenargs, **kwargs). You can capture the output of any given command. Check the Python 2.7 subprocess doc in here

import subprocess
msg = subprocess.check_output([MatlabExePth, "-nosplash", "-wait", "-logfile", "FileIoReg_MatlabRemoteRun.log", "-minimize", "-r", fname, ", exit"])
print msg

Post a Comment for "Returning Gracefully From Matlab Back To Python"