Code covered by the BSD License  

Highlights from
InsertHeader

5.0

5.0 | 3 ratings Rate this file 17 Downloads (last 30 days) File Size: 3.79 KB File ID: #12323
image thumbnail

InsertHeader

by Dan K

 

19 Sep 2006 (Updated 09 Nov 2011)

Inserts a user defined header in the m file currently open in editor

| Watch this File

File Information
Description

% InsertHeader Adds a template to the top of current file in editor for documentation.
% InsertHeader('filename')

% Example
% InsertHeader('InsertHeader') added the current header information to this
% file. NOTE: THIS CANNOT BE UNDONE! THE FIRST TIME YOU USE THIS, PLEASE
% HAVE A BACK UP COPY OF THE FILE IN CASE IT MAKES A MISTAKE.
% Custom defined headers can be created in the subfunction defined at
% the end of the file. I wish to express thanks to the authors of tedit.m and
% newfcn.m which helped me to create this routine.
% See also: tedit, newfcn

The manner in which I use it is to define a shortcut with the command InsertHeader(). That way when I click the shortcut my header is automatically inserted into whichever file is on top.

Note: If you use keyword expansion with your source control software, it will replace the strings in your template, if you check this file in... so plan on correcting the text before you use it.

This function does perform calls to Java commands which are not part of the normal documentation.

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
NEWFCN, TEDIT

MATLAB release MATLAB 7.13 (2011b)
Other requirements I haven't tested it, but this will probably not work without java
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
20 Oct 2008 Carlos Adrian Vargas Aguilera

This is a nice function DAN. Why don't you extract thos little but useful (to me :)) subfunction you use like the one to look for the current file, others to save the file, toget the list of the opened files, etc?

Carlos

15 Feb 2010 Andre Guy Tranquille  
27 Apr 2011 K E

Very useful function, but has stopped working when I switched to R2011a. Generates some java errors.

10 Nov 2011 Dan K

KE,
 I've updated the code to work again with R2011b. Let me know if there are any issues.
Dan

Please login to add a comment or rating.
Updates
24 Oct 2006

Added automatic parsing of inputs, outputs, and automatic listing of subfunctions

09 Nov 2011

2011-11-09: Updated to be compatible with versions of Matlab after 2010b

Tag Activity for this File
Tag Applied By Date/Time
development environment Dan K 22 Oct 2008 08:40:01
text header editor rcs keywords revision control template Dan K 22 Oct 2008 08:40:01
header Jose Ercolino 02 Jun 2010 23:14:25
h1 line Jose Ercolino 02 Jun 2010 23:14:31
function Jose Ercolino 02 Jun 2010 23:14:38

Contact us at files@mathworks.com