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. A subfunction ,visible only to the other functions in the same file, is created by defining a new function with the function keyword after the body of the preceding function or subfunction.
Functions normally return when the end of the function is reached.
Use a return statement to force an early return. Checks to see if the name is a function in a private directory. Locates any and all occurrences of function in method directories and on the path. Order is of no importance. Constructors have higher precedence than anything else.