Why isn't the default directory of savefig() the folder where the file is?

No, Matlab interprets relative paths with respect to the current working directory, just like Julia (and Python, I believe).

And rightly so. Now, if I want to do similar analysis on data in a different folder, is simply cd into the folder and rerun my code, confident that data will be saved to the correct relative position. It would be very inconvenient if I had to actually copy the code into each folder to achieve the same effect.

(There are of course multiple ways to achieve this, but I strongly support the status quo here.)

1 Like