How to pass a matlab string as an exclamation point command

3 次查看(过去 30 天)
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 个评论
Dominik Mattioli
Dominik Mattioli 2019-7-25
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?

请先登录,再进行评论。

采纳的回答

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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Structures 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by