Automatic template for new functions

版本 1.0.0.0 (3.6 KB) 作者: Jonas
newFunction creates an empty function with custom header
1.7K 次下载
更新时间 2010/3/31

查看许可证

If you're tired of re-typing or re-copying the same header structure over and over, newFunction may be what you're looking for.

In the command window, call
newFunction myNewFunctionName
or
newFunction('myNewFunctionName')

First, newFunction checks for whether there already exists another function with the same name.

Second, an input dialog appears that requires you to enter a H1-line (one sentence description), and a synopsis (make sure you type the function name in the correct case! You can also already list explanations for input and output argument, and you can choose whether it'll be a function or a class.

Third, newFunction asks for the save directory for the function.

Fourth, newFunction creates the new function (or classdef) file with a header that includes the synopsis, the description of inputs and outputs (if provided), the Matlab version, the date and the name of the user who created the function.

Finally, newFunction opens the file in the editor and you're ready to go.

引用格式

Jonas (2024). Automatic template for new functions (https://www.mathworks.com/matlabcentral/fileexchange/27132-automatic-template-for-new-functions), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2010a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Environment and Settings 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
版本 已发布 发行说明
1.0.0.0