ftoc (v1.2)

버전 1.2.0.0 (3.1 KB) 작성자: Kenneth Eaton
Creates a table of contents of functions contained in an m-file
다운로드 수: 3.5K
업데이트 날짜: 2009/5/19

라이선스 보기

Since some of the m-files I work with are very large, and contain many nested functions and subfunctions, I find it helpful to keep a short and simple table of contents in the top comment block that tells me which functions are in the m-file, their line numbers, and how they are nested. I wrote FTOC to generate this function table of contents automatically. This was inspired by a posting by Yair Altman on the mathworks newsgroup where he described how to use the undocumented function MLINTMEX. If you're interested in getting even greater detail about m-file contents, you should check out the postings by Urs Schwarz acknowledged below.

Here's how FTOC is used:

STR = FTOC(FILE) returns a character array table of contents STR for all nested functions and subfunctions within the m-file FILE (built-in functions are not displayed). The line numbers of each function are included, and the indentation of the function names indicates the nesting order. FILE should be an m-file name. If FILE is not found, or there are no subfunctions or nested functions, STR will be an empty string.

STR = FTOC(FILE,'insert') will return a character array table of contents STR formatted for the purpose of inserting it into the header comment block of the m-file FILE. Each line begins with the character '%' and the line numbers are adjusted to account for the fact that STR will be inserted somewhere within the top comment block of FILE. (NOTE: you will want to first remove any old table of contents from the comment block before pasting the new one in, to make sure the line numbers are adjusted correctly.)

(See function help for examples)

인용 양식

Kenneth Eaton (2024). ftoc (v1.2) (https://www.mathworks.com/matlabcentral/fileexchange/20164-ftoc-v1-2), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R14SP3
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
1.2.0.0

Fixed description and acknowledgements

1.1.0.0

A couple minor changes in the file, an updated description, and a couple acknowledgments added.

1.0.0.0

Small fixes to reduce mlint messages.