Matlab mit subprocess.call
Verfasst: Sonntag 10. April 2016, 15:19
Hallo,
ich versuche gerade über die subprocess.call Funktion Matlab zu bedienen.
Folgendes funktioniert schon:
import subprocess
retcode = subprocess.call(["matlab", "-nosplash", "-nodesktop", "-r", "pythonTest;quit;"])
Dabei wird die Matlab-Version gestartet, die im Pfad der Umgebungsvariable ganz vorn steht. Ich möchte aber selbst entscheiden, welche Matlab-Version gestartet wird. Daurum habe ich folgendes versucht:
#externesProgramm = "\"C:\Program Files (x86)/MATLAB/R2012a/bin/matlab.exe\""
externesProgramm = "\"C:\Program Files/MATLAB/R2015b/bin/matlab.exe\""
import subprocess
retcode = subprocess.call([externesProgramm, "-nosplash", "-nodesktop", "-r", "pythonTest;quit;"])
Leider erhalt eich dann folgenden Fehler:
Traceback (most recent call last):
File "C:\Users\user\Dropbox\Master-Arbeit\Python-Skripte\helloworld\src\test.py", line 13, in <module>
retcode = subprocess.call([externesProgramm, "-nosplash", "-nodesktop", "-r", "pythonTest;quit;"])
File "C:\Python34\lib\subprocess.py", line 535, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Python34\lib\subprocess.py", line 848, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1104, in _execute_child
startupinfo)
PermissionError: [WinError 5] Zugriff verweigert
Weiss jemand, wie ich selbst entscheiden kann, welche meiner Matlab-Installationen ich ausführe?
ich versuche gerade über die subprocess.call Funktion Matlab zu bedienen.
Folgendes funktioniert schon:
import subprocess
retcode = subprocess.call(["matlab", "-nosplash", "-nodesktop", "-r", "pythonTest;quit;"])
Dabei wird die Matlab-Version gestartet, die im Pfad der Umgebungsvariable ganz vorn steht. Ich möchte aber selbst entscheiden, welche Matlab-Version gestartet wird. Daurum habe ich folgendes versucht:
#externesProgramm = "\"C:\Program Files (x86)/MATLAB/R2012a/bin/matlab.exe\""
externesProgramm = "\"C:\Program Files/MATLAB/R2015b/bin/matlab.exe\""
import subprocess
retcode = subprocess.call([externesProgramm, "-nosplash", "-nodesktop", "-r", "pythonTest;quit;"])
Leider erhalt eich dann folgenden Fehler:
Traceback (most recent call last):
File "C:\Users\user\Dropbox\Master-Arbeit\Python-Skripte\helloworld\src\test.py", line 13, in <module>
retcode = subprocess.call([externesProgramm, "-nosplash", "-nodesktop", "-r", "pythonTest;quit;"])
File "C:\Python34\lib\subprocess.py", line 535, in call
with Popen(*popenargs, **kwargs) as p:
File "C:\Python34\lib\subprocess.py", line 848, in __init__
restore_signals, start_new_session)
File "C:\Python34\lib\subprocess.py", line 1104, in _execute_child
startupinfo)
PermissionError: [WinError 5] Zugriff verweigert
Weiss jemand, wie ich selbst entscheiden kann, welche meiner Matlab-Installationen ich ausführe?