How to pass a matlab string as an exclamation point command

1 vue (au cours des 30 derniers jours)
Dominik Mattioli
Dominik Mattioli le 25 Juil 2019
Réponse apportée : Rik le 25 Juil 2019
pathName = '.../foldername/subfoldername'
scriptName = 'main.py'
How do you issue a command to run some file in that folder without changing your working directory or current folder?
!python (pathName)/main.py &
This fails.
Capture.PNG
  1 commentaire
Dominik Mattioli
Dominik Mattioli le 25 Juil 2019
I suppose it's not the end of the world to temporarily change the working directory, but isn't there a way to accomplish this without doing that?

Connectez-vous pour commenter.

Réponse acceptée

Rik
Rik le 25 Juil 2019
If you use the system function instead of the exclamation point operator you can pass a fully parsed char array.

Plus de réponses (0)

Catégories

En savoir plus sur Call Python from MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by