MATLAB: Does the ‘Contents Report’ repeat the filename if it is present in the first line of comments in the MATLAB file

contentsMATLABreport

I have a "FileName.m" file that has the following first line:
% FileName – This file does something.
If I type "help directory" and there is no "Contents.m" file I get:
FileName This file does something.
Now if I create a "Contents.m" using the 'Contents Report', the contents file will have
FileName – FileName This file does something.
That is, the filename is pre-pended and shows up twice.

Best Answer

The 'Contents Report' tool can be forced to prevent the duplication if the first line in the "FileName.m" file contains the name of the file in all capital letters. For example:
% FILENAME This file does something
Please refer to the following documentation for more information: