Programming and Data Types    

Providing Help for Your Programs

You can provide user information for the programs you write by including a help text section at the beginning of your M-file. This section starts on the line following the function definition and ends at the first blank line. Each line of the help text must begin with a comment (%) character. MATLAB displays this information whenever you type

You can also make help entries for an entire directory by creating a file with the special name Contents.m that resides in the directory. This file must contain only comment lines; that is, every line must begin with a percent sign. MATLAB displays the lines in a Contents.m file whenever you type

If a directory does not contain a Contents.m file, typing help directory_name displays the first help line (the H1 line) for each M-file in the directory.


  What's in an M-File? Creating M-Files: Accessing Text Editors