Generate a new function m-file, with documentation

버전 1.1.0.0 (3.11 KB) 작성자: Richie Cotton
This makes it really easy to document your functions in a standard format.
다운로드 수: 1.6K
업데이트 날짜: 2010/4/12

라이선스 보기

Having your m-files documented in a standard way (or at all!) is very useful for sharing code between projects, and between people. The trouble is, clicking File -> New -> Function doesn't give you much to go on, and it is very easy to be lackadaisical about writing thorough and consistent documentation.

GenerateFunctionMFile() creates a new untitled m-file with placeholder documentation, and opens the file in the editor.

GenerateFunctionMFile(true), works as above but prompts you for the name of the function.

The layout includes $Author, $Date and $Revision tags, which are automatically completed for you. If you use CVS or SVN as your version control system, then checking in your file will automatically cause these fields to be updated.

Since typing is a lot of effort, also included is a function called "new", which is a wrapper for GenerateFunctionMFile(true), so all you need to do to create a new file with documentation is type new, and the function name. Easy!

Note: You'll probably want to play with the template of the created m-file to suit your own needs. (At the very least, you'll want to change the copyright line to that of your own company.)

인용 양식

Richie Cotton (2024). Generate a new function m-file, with documentation (https://www.mathworks.com/matlabcentral/fileexchange/27225-generate-a-new-function-m-file-with-documentation), 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.1.0.0

Acknowledged inspiration.

1.0.0.0