sponsor Vim development Vim logo Vim Book Ad

GenerateMatlabFunctionComment : Generates documentation structure for a matlab function.

 script karma  Rating 11/7, Downloaded by 1257  Comments, bugs, improvements  Vim wiki

created by
Vinay Middha
 
script type
utility
 
description
Generates a comment skeleton for a matlab function.

For example:
function xs = get_slantx(x, y, angle)
When the script (VERSION 0.3) is run on this line the output is like:
function xs = get_slantx(x, y, angle)
% get_slantx  
%
% Input:
% ^^^^^^
% . x
% . y
% . angle
%
% Output:
% ^^^^^^^
% . xs
%% AUTHOR  Author Name

This format is compatible with Matdoc. See version comments below to know more about Matdoc.

For previous versions the output looks similar to:
% get_slantx  
% function xs = get_slantx(x, y, angle)
% PARAM xs [OUT]
% PARAM x [IN]
% PARAM y [IN]
% PARAM angle [IN]
% AUTHOR  Author Name

This script is derived from MakeDoxygenComment by Leif Wickland.

After the installation you can run the script simply by hitting <ALT+c> when the cursor is on function line.

 
install details
Copy the script in vim61/macros/ and add these lines to your _vimrc.

source $VIMRUNTIME/macros/MakeMatlabComment.vim

map <M-c> :call MakeMatlabComment()<CR>
imap <M-c> <ESC>:call MakeMatlabComment()<CR>
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
MakeMatlabComment.vim 0.4 2003-06-30 6.0 Vinay Middha Cleaner implementation with comments.
MakeMatlabComment.vim 0.3 2003-06-16 6.0 Vinay Middha The comment syntax is now compatible with Matdoc. Matdoc is a program that extracts the documentation of matlab functions, and converts it to vim help files, html, latex, etc., much as doxygen does for C/C++. Matdoc is written by Moshe Kaminsky and is available on matlabs fileexchange site.
MakeMatlabComment.vim 0.2 2003-06-14 6.0 Vinay Middha Fixed error that occurs when used on matlab function without any output argument.
MakeMatlabComment.vim 0.1 2003-06-13 6.0 Vinay Middha Initial upload
ip used for rating: 18.119.111.9

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github