When you type a command, matlab has to decide how to respond. First it
checks to see if it has a built in function of that name. Then it
checks through a list of directories looking for an appropriately named
file.
To see what's actually going to be run when you type a command,
use which - e.g. which sum shows that the sum
command is built into matlab.
To see what directory matlab's in, type pwd. To change
directories use the cd command.
what lists the matlab-specific files in the current directory.
To see which directories are searched, use path. Most of the
directories in the path belong to matlab. The final place it looks is
the current directory. If you have a subdirectory called matlab
in your home directory, matlab will look there before looking in any other
directory. The ordering of these directories matters - if you have a
file in the current directory that's the same name as a system file, the
system's file will be run rather than yours.