How to pass a matlab string as an exclamation point command

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

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일

1 개 추천

If you use the system function instead of the exclamation point operator you can pass a fully parsed char array.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Cell Arrays에 대해 자세히 알아보기

질문:

2019년 7월 25일

답변:

Rik
2019년 7월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by