0

I'm trying to run a MATLAB script from a python script (using os.system to run it in the command line) and I'm having this error:

'MATLABScriptName' is not found in the current folder or on the MATLAB path, but exists in:
    /Users/path/to/where/it/exists

Change the MATLAB current folder or add its folder to the MATLAB path.

I don't have this issue when I'm running the same command from the terminal as opposed to the python script. The MATLAB script is in the same directory where the python script is and where I'm running the python script from.

What can I do to make MATLAB recognize the current directory as the current folder?

Thanks!

snakecharmerb
  • 47,570
  • 11
  • 100
  • 153
Ani
  • 53
  • 1
  • 8
  • 3
    can you share the commands you are running from command line and python? – arryph Dec 15 '20 at 21:15
  • 2
    Does this answer your question? [How do I change the working directory in Python?](https://stackoverflow.com/questions/431684/how-do-i-change-the-working-directory-in-python) – noslenkwah Dec 15 '20 at 22:23
  • @noslenkwah yes it did, I didn't realize that the reason of the error was that I was changing the current directory in the python script, thanks – Ani Dec 16 '20 at 08:42

0 Answers0