In the basic case, m-files are just text files containing matlab commands. They can be compiled in order to run faster, but for our purposes we'll ignore that. Matlab will search the current directory (the one from which it was run), as well as any directories on its load path.