To customize function completion in MATLAB, follow the steps below:
Define the function signature in a file with the same name as the function and a .m
extension. For example, if your function is named myfunction
, create a file named myfunction.m
.
In the function file, add a comment block immediately below the function
declaration that provides usage information in the following format:
main.m252 chars19 lines
Note that the first line of the comment block must match the function name and it must be followed by a short one-line description of the function's purpose.
Save the function file.
From now on, when you type myfunction(
in the MATLAB command window or editor, the function signature and usage information will be displayed in the drop-down menu.
gistlibby LogSnag