Create Help Summary Files — Contents.m
In this section...
“What Is a Contents.m File?” on page 30-12
“Create a Contents.m File” on page 30-12
“Check an Existing Contents.m File” on page 30-13
What Is a Contents.m File?
A Contents.m file provides a summary of the programs in a particular folder. The help,
doc, and ver functions refer to Contents.m files to display information about folders.
Contents.m files contain only comment lines. The first two lines are headers that
describe the folder. Subsequent lines list the program files in the folder, along with their
descriptions. Optionally, you can group files and include category descriptions. For
example, view the functions available in the codetools folder:
help codetools
Commands for creating and debugging code
MATLAB Version 9.3 (R2017b) 24-Jul-2017
Editing and publishing
edit - Edit or create a file
grabcode - Copy MATLAB code from published HTML
mlint - Check files for possible problems
publish - Publish file containing cells to output file
snapnow - Force snapshot of image for published document
Directory tools
mlintrpt - Run mlint for file or folder, reporting results in browser
visdiff - Compare two files (text, MAT, or binary) or folders
...
If you do not want others to see a summary of your program files, place an empty
Contents.m file in the folder. An empty Contents.m file causes help foldername to
report No help found for foldername. Without a Contents.m file, the help and
doc commands display a generated list of all program files in the folder.
Create a Contents.m File
When you have a set of existing program files in a folder, the easiest way to create a
Contents.m file is to use the Contents Report. The primary purpose of the Contents
30 Custom Help and Documentation