How to pass a matlab string as an exclamation point command

9 views (last 30 days)
pathName = '.../foldername/subfoldername'
scriptName = ''
How do you issue a command to run some file in that folder without changing your working directory or current folder?
!python (pathName)/ &
This fails.
  1 Comment
Dominik Mattioli
Dominik Mattioli on 25 Jul 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?

Sign in to comment.

Accepted Answer

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

More Answers (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!

Translated by