mfileread

버전 1.0.0.0 (1.69 KB) 작성자: Mathias Benedek
This function separately returns the code part and the comment part of an m-file
다운로드 수: 385
업데이트 날짜: 2010/12/19

라이선스 보기

This function reads a Matlab m-file, trims the content (removing empty lines and unnecessary spaces), and divides the content into code and comment part.
It returns a struct with fields holding information on the number of non-empty lines, and three strings representing the whole text, the code part, and the comment part.

This function can be used to access and analyze code and comments seperately.
It could e.g. also be used to generate a trimmed copy of an m-file with all comments removed by entering

mfinfo = mfileread(fname);
fid = fopen(fname2, 'wt');
fprintf(fid,'%s',mfinfo.code);
fclose(fid)

인용 양식

Mathias Benedek (2024). mfileread (https://www.mathworks.com/matlabcentral/fileexchange/29780-mfileread), MATLAB Central File Exchange. 검색됨 .

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

Community Treasure Hunt

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

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