How do MATLAB M-files work?
MATLAB statements can be prepared with any editor, and stored in a file for later use. Such a file is referred to as a script, or an “m-file” (since they must have a name extension of the form filename.m). Writing m-files will enhance your problem solving productivity. Suppose that we create a program file myfile.m in the MATLAB language. The commands in this file can be exectued by simply giving the command myfile from MATLAB. The MATLAB statements will run like any other MATLAB function. You do not need to compile the program since MATLAB is an interpretative (not compiled) language.