This page looks specifically at how to read and modify your search path. For the most basic of basics, check out MatlabBasics. As well, MatlabProgramming talks about hw to read m-files and program with them, and MatlabDebugging touches specifically on strategies for troubleshooting - how to get more information, what parts of error messages to look for, and how you can dig through a script to find what's gone wrong.
In the following, text in fixed-width font are commands that you can type directly into Matlab.
Every time you type a name in Matlab - of a variable, a function, a script, anything - the program goes through a certain procedure to figure out what you're referring to. It'll first look in its workspace for variables of that name; if it doesn't find anything, it will assume you're trying to refer to a function, script, or .mat file. Matlab always looks first in the present working directory for the .m file or .mat file of the given name, but if it doesn't find one there, it has a specified sequence of directories it looks in.
This directory list is called the path. It's similar to the Linux concept of the same name. Maintaining and manipulating your path can be crucial to running Matlab programs and keeping track of different versions of functions. Fortunately, Matlab makes it pretty easy to work with paths.
You can always look at your path in Matlab by typing path; Matlab searches the output list from top to bottom. The easiest way to work with your path is by typing "pathtool" at the Matlab prompt. That'll open up a graphical interface that will display your current path, let you easily add or remove directories, or re-order what's in there already.
If you're curious where on your path a particular m-file is, you can type which filename; this will tell you the location of the first copy of that file Matlab hits on the path, and hence which version of the file it will run. If you type open filename and filename is on your path, open will open the first copy it hits on the path. These two commands can be super helpful in figuring out whether you've got the right version of code, as well as figuring out where functions are located.
Matlab has a whole bunch of directories it adds into the path when it starts up by default, and the Gablab-specific commands to start Matlab - spm99-6-devel, spm2, spm2-devel, etc. - are essentially distinguished only by what directories they add to the path. If you call spm99-6-devel, the only difference from calling spm99-6 is that you'll get the spm99/devel directory on the top of your path above the standard spm99 directory. This means Matlab will find the development code first when it searches for functions, and it'll run the most current version of SPM that's stored in that directory. spm2-devel and spm99-6-devel differ only because they add different spm version directories.