removeComments(filename,commentIndicator)
Version 1.0.0.1 (1.32 KB) by
Brett Shoelson
Returns the contents of a file with comments stripped.
Specify the name of a file and (optionally) the character indicator for a comment, and removeComments will return (in a cell array or a char) the line-by-line contents of the file without comments.
Cite As
Brett Shoelson (2026). removeComments(filename,commentIndicator) (https://se.mathworks.com/matlabcentral/fileexchange/48057-removecomments-filename-commentindicator), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2014b
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
- Mathematics and Optimization > Mapping Toolbox > Data Import and Export >
- Radar > Mapping Toolbox > Data Import and Export >
Find more on Data Import and Export in Help Center and MATLAB Answers
Tags
Acknowledgements
Inspired by: % MATLAB Comment Stripping Toolbox
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
