File Exchange

image thumbnail

% MATLAB Comment Stripping Toolbox

version 1.0 (5.32 KB) by

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

12 Downloads

Updated

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

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.

Comments and Ratings (11)

I will improve my rating once the missing feature of removing %{ ... %} multiline comments is added. Besides that it's fantastic.

how to use this?

comm@ZeoN

Very effective.

Rody Oldenhuis

Rody Oldenhuis (view profile)

Awesome, thanks :)

Oleg Komarov

Oleg Komarov (view profile)

Ideal for matlab contests...

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

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

 

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.

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.

Balaji Rangaswamy

Brett Shoelson

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

MATLAB Release
MATLAB 6.5 (R13)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video