ipunished
ipunished

Reputation: 694

Setting a path in OSX for Matlab

I just shifted from a windows machine to a apple machine at work. I have no experience with apple and this is the first time I am using OSX.

I have a matlab script that I have to run on this machine but I cannot seem to get the path to my files.

My files are on a network drive. In windows its as simple as U:\Matlab Now I can access my files in the explorer but cannot seem to set them in Matlab using cd

To get the path of my files I right clicked on the folder and copied the where It provided me with this:

Volumes/home9/MATLAB/

Now to set these paths in Matlab I did this:

cd('Volumes/home9/MATLAB/')

But am provided with the error:

Cannot CD to Volumes/home9/MATLAB/ (Name is nonexistent or not a directory).

As you can tell I have no idea what I am doing. Some guidance would be appreciated.

Thank you

Upvotes: 0

Views: 2360

Answers (1)

rayryeng
rayryeng

Reputation: 104464

I think you meant to use which, not where. where doesn't exist in MATLAB! Now, your problem is probably due to the fact that you need to prepend your path with /. Therefore, your path should be: /Volumes/home9/MATLAB/. If you don't include the /, it assumes that the directory is local or where MATLAB has currently defined the working directory to be. Judging from the context, you want the absolute path of the directory, and that's why you need the / character as there is a Volumes directory in your root directory.

Try that and see if that works!

Upvotes: 1

Related Questions