New m-file (dynamical/document​ed header)

版本 1.0.0.0 (3.8 KB) 作者: Benjamin Pillot
new m-file with dynamical/documented header acting as the usual "new file" matlab desktop shortcut
459.0 次下载
更新时间 2016/5/11

查看许可证

This function creates a new class/function/script following the same behaviour as the "new file" desktop short-cut, except that headers are dynamically implemented, customizable and adapted for further code documentation.
The function comes with 3 default headers corresponding to 'class', 'function' and 'script' files. Feel free to adapt these header files to your own needs. They have been implemented based on the template headers proposed by Denis Gilbert, in order to facilitate the further code documentation (using mtoc++/doxygen for example).
Even if the templates are customizable, some part are implemented dynamically during the opening of the new class/function/script, such as date of creation, file name, copyright year, etc.
Basically, I have made a compilation of different tools available on the File exchange. But I wanted a tool both simple and powerful, and, most of all, able to efficiently replace the "new file" Matlab desktop short-cut, in such a way that it remains invisible to the user. To do this, you just have to add a short-cut to your short-cut toolbar using the Shortcut Editor, with callback : "new('f')" (function), "new('s')" (script) or "new('c')" (class).
Add command to Shortcut panel :
- On the Home tab, click New, and then select Command Shortcut. Or click on the "New Shortcut" in the quick access toolbar.
- In the Shortcut Editor, choose a "Label" (such as "new function"), an Icon (such as "f") and fill the "Callback" edit text panel with the corresponding command (such as "new('f')").
- Click "Save".
That's all. Whenever you want to change the headers' format, edit the corresponding file('default_function', 'default_class' or 'default_script') and save changes.

引用格式

Benjamin Pillot (2024). New m-file (dynamical/documented header) (https://www.mathworks.com/matlabcentral/fileexchange/57079-new-m-file-dynamical-documented-header), MATLAB Central File Exchange. 检索来源 .

MATLAB 版本兼容性
创建方式 R2014a
兼容任何版本
平台兼容性
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!

Buffer templates/

版本 已发布 发行说明
1.0.0.0

Picture update

Description update