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?
How to pass a matlab string as an exclamation point command
조회 수: 7(최근 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.

채택된 답변
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
추가 답변(0개)
참고 항목
범주
Find more on Entering Commands in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!