Running mod file in different directory

Hi, this is a very simple question. How can I run the .mod file without having to change to the directory where I have my .mod file? Say I have a myfile.mod sitting on /MYDIR/. I have tried the following from Matlab’s command line:



Non of these works, is this even possible?


That is simply not possible. Why do you want to stay in a different directory?

Thanks for the reply. I want to do this because I have a main script that calls an mod file and other functions and would like to keep all my Dynare related files in a different directory to avoid cluttering my main directory. For now the main script manually change the directory to where my mod file is to run Dynare and then go back to the main directory, but I was hoping for a simpler way to do it.

Thanks again!