Site hosted by Angelfire.com: Build your free website today!

mlstripcommentsstr

PURPOSE ^

MLSTRIPCOMMENTSSTR Strip comments from a string with MATLAB code.

SYNOPSIS ^

function ostr = mlstripcommentsstr(istr)

DESCRIPTION ^

MLSTRIPCOMMENTSSTR Strip comments from a string with MATLAB code.

   OSTR = MLSTRIPCOMMENTSSTR(ISTR) takes the input string ISTR, assuming it
   contains MATLAB code, strips all MATLAB comments, and returns the result as
   the output string OSTR.  The input string must be a row vector or a cell
   array of row vectors.  Any input string may be a multi-line string, that is
   a string containing newline characters, for example a string containing the
   entire contents of an m-file.

   Example:  Read all MATLAB code from an m-file opened for reading on file
   identifier "fid" and strip all comments:

       str = fread(fid);               % data as numerical column vector
       str = char(str)';               % data as character row vector
       str = mlstripcommentsstr(str);  % strip all MATLAB comments

   See also MLSTRIPCOMMENTSFILE, MLSTRIPCOMMENTSFID.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^


Generated on Sat 12-Mar-2005 01:01:49 by Rezaul Karim © 2004