The existing commands and functions that compose the new function reside in a text file called an M-file . M-files can be either scripts or f unctions .
Functions make use of their own local variables and accept input arguments.
The name of an M-file begins with an alphabetic character, and has a filename extension of . A line at the top of a function M-file contains the syntax definition. The name of a function, as defined in the first line of the M- file, should be the same as the name of the file without the .m extension. For example, the existence of a file on disk called stat . The variables within the body of the function are all local variables.