Code covered by the BSD License  

Highlights from
% MATLAB Comment Stripping Toolbox

4.6

4.6 | 5 ratings Rate this file 8 Downloads (last 30 days) File Size: 5.32 KB File ID: #4645
image thumbnail

% MATLAB Comment Stripping Toolbox

by Peter J. Acklam

 

18 Mar 2004 (Updated 22 Mar 2004)

A small collection of utilities for stripping MATLAB comments from strings and files.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

| Watch this File

File Information
Description

This is a small collection of utilities for stripping MATLAB comments from MATLAB code. The code may be given in strings, cell arrays of strings, or read from a file or file identifier. There is full support for stripping comments from multi-line strings, that is strings with embedded newlines, which typically appear when an entire file is read in one go.

Acknowledgements
This submission has inspired the following:
missingsemicolons
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (6)
24 Mar 2004 Brett Shoelson

Excellent! This is regular expressions on steroids...makes quick work of comment stripping. Thanks, Peter.

27 Jul 2005 Balaji Rangaswamy  
29 Mar 2006 Scott Otterson

Useful. A bit out of date, though: With R14, I'm getting a many copies of this warning:

Warning: The 'tokenize' option for regexprep is now the default behavior. If I remove 'tokenize' it goes away.

09 Oct 2009 Muhammad Arsalan

hi, very nice application. But when it works perfect up to line 277 after that it don't work as it supposed to work. There there anything that i can change?? like some memory limitations?? i need to use it on a file with 17000 lines. Any suggestions please.

12 Nov 2009 Carlos Adrian Vargas Aguilera

Great functions. Only my comments after a three points were left!

 

12 Nov 2009 Carlos Adrian Vargas Aguilera

Oh, besides of the NOT ignored lines after "...", also grouped comments are NOT ignored:
%{
bla
bla
%}
Carlos

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
strings Peter J. Acklam 22 Oct 2008 07:16:42
matlab Peter J. Acklam 22 Oct 2008 07:16:42
comments Peter J. Acklam 22 Oct 2008 07:16:42
strip Peter J. Acklam 22 Oct 2008 07:16:42
stripping Peter J. Acklam 22 Oct 2008 07:16:43
utilities Peter J. Acklam 22 Oct 2008 07:16:43

Contact us at files@mathworks.com