File System Commands

To find the current paths which Matlab will search to find .m files, use the path command.

To add a new directory to the path, use, for example, the following command:

>> path( path, 'C:\Documents and Settings\dwharder\My Documents\My Matlab' );  % in Windows using Matlab
>> path( path, '/Documents and Settings/dwharder/My Documents/My Matlab' );  % in Windows using Octave
>> path( path, '~dharder/matlab' );  % in Unix

Matlab also uses the current working directory to find .m files. The command pwd prints the current working directory.

You can list the contents of the current working directory by using the command dir or ls.

You can use the cd command to change the current directory. For example:

>> cd 'C:\Documents and Settings\dwharder\Desktop\'

will change the current directory to my desktop, so any .m files saved there will be accessed.

It seems that you must place your .m files in the directory C:\Program Files\GNU Octave 2.1.36\octave_files or in subdirectories thereof if you want to use the current working directory feature.