N = COUNTCODE(MFILE) returns the number of code lines in MFILE. MFILE should be a string containing a name to an existing m-file or asv-file.
[N,M] = COUNTCODE(MFILE) also returns the number M of commented lines in the file. [N,M,S,Q] = ... further returns a cell array of strings S containing all lines of the file (code and comment, but excluding empty lines) and a logical vector Q with ones for the comment lines of S.
Note: this file use <regexp>
Cite As
Jos (10584) (2026). COUNTCODE (https://www.mathworks.com/matlabcentral/fileexchange/10175-countcode), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R13
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on String Parsing in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 |
