No BSD License  

Highlights from
htmltool

htmltool

by

 

The HTML Toolbox (HT) stores various crosslink information about Matlab programs using HTML.

com_read(file)
function U = com_read(file)
% U = com_read(file)
% Reads all comment line beginning with %
% and returns a matrix of strings
%
% INPUT PARAMETER
%
% file    = name of m-file
%
% OUTPUT PARAMETER
%
% U       = matrix with each comment line
%
% Copyright (c), 1996 B.K. Alsberg
%

fid = fopen(file,'r');
U = [];

% Here we read the first function call line
fgetl(fid);
% The max length of a comment line:
n = 150;

while feof(fid) ~= 1,

 str = fgetl(fid);
 if length(str)>0,
  s = deblank(fliplr(str));
 else
  s = ['#'];
 end;
 s = fliplr(s);
 if length(s) >0
  if s(1) ~= '%'
    break
  else
   q = [s blanks(n-length(s))];
   U = [U;q];
  end
 end;
end;

Contact us