View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Documenting (help section of) an m-file

5.0 | 1 rating Rate this file 5 Downloads (last 30 days) File Size: 3.84 KB File ID: #41423 Version: 1.0

Documenting (help section of) an m-file


Guzman (view profile)


This script makes a template for documenting m-files.

| Watch this File

File Information

This piece of code writes a template for documenting m-files. It writes the template just after the function definition header. It finds out which are the input and output arguments (if any) and writes them down in the documentation/help section.
The script also uses Malcolm Wood's subission at
to find the dependencies of the script and annotate them into the the help section.
For instance, by introducing:
>> DocFun('DocFun', 'Guzmán Díaz')
it documents 'DocFun.m' proper.
That is, it finds the input and output arguments, the dependencies, the date, Matlab version, and leaves the rest to be completed by the author.
Because things might go terribly wrong, the script makes a copy (with extension .bak) of the original file before proceeding; which must be manually deleted if results are satisfactory.


Export To Zip: Identifies The Dependencies Of An M File And Creates A Zip File inspired this file.

This file inspired Signal Simulation and Signal With Noise.

Required Products MATLAB
MATLAB release MATLAB 7.10 (R2010a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (1)
16 Sep 2014 Jeffrey Chiou

Works great! Gives this warning though:
Warning: DEPFUN will be removed in a future release. Use matlab.codetools.requiredFilesAndProducts instead.
> In depfun at 258
In DocFun>i_scan at 271
In DocFun>mydepfun at 237
In DocFun at 139

Contact us