| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
See also M-Lint Code Check Report, and the File and Folder Comparisons tool.
Reports help you refine the M-files in a folder and improve their performance. They are also useful for checking the quality of files before you distribute them for use by others, such as for a finished project, to share on MATLAB Central, or for a toolbox. (A toolbox is a collection of files for use with MATLAB and related products.)
Access reports from the MATLAB Current Folder browser, as follows:
Select Desktop > Current Folder.
Navigate to the folder containing the M-files for which you want to produce reports.
On the Current Folder browser toolbar,
click the Actions button
, and then select the type of report
you want to run for all the M-files in the current folder.

The report you select appears as an HTML document in the MATLAB Web Browser.
Note You cannot run reports when the path is a UNC (Universal Naming Convention) path, that is, starts with \\. Instead, use an actual hard drive on your system, or a mapped network drive. |
All M-File reports contain various links that enable you to access additional information, as described in the table that follows:
| To | Do this |
|---|---|
| Open a file in the Editor to view it or make changes to it. | Click a file name in the report. |
| Open a file at the line listed in a report. | Click the line number. |
| Update a report after making changes to the report options. | Click Rerun This Report. |
| Update a report after changing any files in the folder. | Click Rerun This Report. |
| Generate the same type of report for a different folder. |
|
Note Clicking Rerun This Report reruns the report for the folder shown in the report, not for the MATLAB current folder. |
The TODO/FIXME Report identifies all the M-files in a given folder that you have annotated by adding comments with the text TODO, FIXME, or a string of your choosing. This enables you mark, and then find later, areas in an M-File with annotations to indicate that you intend to improve, complete, or perform some other update in the future. The TODO/FIXME Report presents a list of files containing the annotations in a Web browser.
This sample TODO/FIXME Report shows files containing the strings TODO, FIXME, and NOTE. The search is case insensitive.

Select Desktop > Current Folder and navigate to the folder containing the M-files for which you want to produce a TODO/FIXME report.
On the Current Folder browser toolbar, click the Actions button
, and then select Reports > TODO/FIXME Report.
The TODO/FIXME Report opens in the MATLAB Web browser.
In the TODO/FIXME Report window, select one or more of the following to specify the lines that you want the report to include:
TODO
FIXME
The text field check box
You can then, enter any text string in this field, including a regular expression. For example, you might enter NOTE, tbd, or re.*check.
Run the report on the M-Files in the current folder, by clicking Rerun This Report
The Window refreshes with a list of all the lines in the M-File programs within the specified folder that contain the strings you selected in step 1. Matches are not case-sensitive.
If you want to run the report on a folder other than the one currently specified in the TODO/FIXME Report window, change the current folder to the one where you want to run the report, and then click Run Report on Current Folder.
To open an M-File in the Editor at a specific line, click the line number in the report. Then you can make changes, as needed.
Suppose you have an M-File, area.m, in the current folder. The code for area.m is shown in the image that follows.

When you run the TODO/FIXME report on the folder containing area.m, with the TODO and FIXME strings selected and the string NOTE specified and selected, the report lists:
| 9 and rectangle. (todo) |
| 14 Fixme: Is the area of hemisphere as below? |
| 17 fIXME |
| 21 NOTE: Find out from the manager if we need to include |

Notice the report includes the following:
Line 9 as a match for the TODO string. The report includes lines that have a selected string regardless of its placement within a comment.
Lines 14 and 17 as a match for the FIXME string. The report matches selected strings in the M-File regardless of their casing.
Line 21 as a match for the NOTE string. The report includes lines that have a string specified in the text field, assuming you select the text field.
A Help Report presents a summary view of the help component of your M-files. Use this information to assist you in identifying files of interest or files that lack a help component. It is a good practice to provide help for your files not only to assist you in recalling their purpose, but to assist others who use the files.
In MATLAB, the M-file help component is all contiguous nonexecutable lines (comment lines and blank lines), starting with the second line of a function M-file or the first line of a script M-file. For more information about creating help for your own M-files, see the reference page for the help function.
Select Desktop > Current Folder and navigate to the folder containing the M-files for which you want to produce a Help Report.
On the Current Folder browser toolbar, click the Actions button
, and then select Reports > Help Report.
The Help report opens in the MATLAB Web Browser.
Select one or more options, described in the following list, to have the Help Report display the specified help information:
Show subfunctions to have the Help Report display help information for all subfunctions called by each function. Help information for subfunctions is highlighted in gray.
Description to have the Help Report display the first line of help in the M-file. If the first comment line is empty, or if there is not a comment before the executable code, then No description line, highlighted in pink, appears instead.
Examples have the Help Report display the line number where the examples section of the M-file help begins. The Help Report looks for a line in the M-file help that begins with the string example or Example and displays any subsequent nonblank comment lines. Select this option to easily locate and go to examples in your M-files.
It is a good practice to include examples in the help for your M-files. If you do not have examples in the help for all your M-files, use this option to identify those without examples. If the report does not find examples in the M-file help, No example, highlighted in pink, appears.
Show all help have the Help Report display complete M-file help, which is all contiguous nonexecutable lines (comment lines and blank lines), starting with the second line of a function M-file, or the first line of a script M-file. The M-file help shown also includes overloaded functions and methods, which are not actually part of the M-file help comments, but are automatically generated when help runs.
If the comment lines before the executable code are empty, or if there are no comments before the executable code, No help, highlighted in pink, appears instead.
See Also have the Help Report display the line number for the see also line in the M-file help. The see also line in M-file help lists related functions. When the MATLAB Command Window displays the help for an M-file, any function name listed on the see also line appears as a link you can click to display its help. It is a good practice to include a see also line in the help for your M-files.
The report looks for a line in the M-file help that begins with the string See also. If the report does not find a see also line in the M-file help, No see-also line, highlighted in pink, appears. This helps you identify those M-files without a see also line, should you want to include one in each M-file.
The report also indicates when an M-file noted in the See also line is not in a folder on the search path. You might want to move that file to a folder that is on the search path. If not, you will not be able to click the link to get help for the file, unless you then add its folder to the path or make its folder become the current folder.
Copyright have the Help Report display the line number for the copyright line in the M-file. The report looks for a comment line in the M-file that begins with the string Copyright and is followed by year1-year2 (with no spaces between the years and the hyphen that separates them).
It is a good practice to include a copyright line in the help for your M-files, that notes the year you created the file and the current year. For example, for an M-file you created in 2001, include this line
% Copyright 2001-2008
If the report:
Does not find a copyright line in the M-file help, No copyright line, highlighted in pink, appears.
Finds that the end of the date range is not the current year, Copyright year is not current, highlighted in pink, appears.
Click Rerun This Report. Your report resembles the following image.

The Contents Report displays information about the integrity of the Contents.m file for a given folder. A Contents.m file includes the file name and a brief description of each M-file in the folder. The Contents Report helps you to maintain the Contents.m file. It displays discrepancies between the Contents.m file and the M-files in the folder.
When you type help followed by the folder name, such as help mydemos, The MATLAB Command window displays the information contained within the mydemos/Contents.m file. For more information, see Providing Help for Your Program in the MATLAB Programming documentation.
Select Desktop > Current Folder and navigate to the folder containing the M-files for which you want to produce a Contents report.
On the Current Folder browser toolbar, click the Actions button
, and then select Reports > Contents Report.
The Contents Report opens in the MATLAB Web browser. If there is no Contents.m file for the folder, the report tells you the Contents.m file does not exist and asks if you want to create one. Click yes to automatically create the Contents.m file. You can edit the Contents.m file in the Editor to include the names of files you plan to create, or to remove files that you do not want to expose when displaying help for the folder, such as files for internal use.
Update the Contents.m file to reflect changes you make to files in the folder. For example, when you remove a file from a folder, remove its entry from the Contents.m file.
The following options are available for updating the contents:
edit Contents.m— Opens the Contents.m file in the Editor.
fix spacing—Automatically align the file names and descriptions in the Contents.m file.
fix all makes all of the suggested changes at once.
To make changes on a case-by-case basis, read each question in the Contents Report, and then click yes if you want to make the suggested change.

No Contents File. This message appears if there is no Contents.m file in the folder. Click yes to automatically create a Contents.m file, which contains the file names and descriptions for all M-files in the folder.
No Contents.m file. Make one? [ yes ]
File Not Found. This message appears when a file included in Contents.m is not in the folder. These messages are highlighted in pink. For example, a message such as
File helloworld does not appear in this folder. Remove it from Contents.m? [ yes ]
means the Contents.m file includes an entry for helloworld, but that file is not in the folder. This might be because:
You removed the file helloworld.
You manually added helloworld to Contents.m because you planned to create the file, but have not as yet.
You renamed helloworld.
Description Lines Do Not Match. This message appears when the description line in the M-file help does not match the description provided for the M-file in Contents.m. These messages are highlighted in pink. Click yes to replace the description in the Contents.m file with the description from the M-file. Or select the option to replace the description line in the M-file help using the description for that file in Contents.m.
Description lines do not match for file logo5. Use this description from the file? (default) [ yes ] logo5 - This is the basic logo image for MATLAB 7 Or put this description from the Contents into the file? [ yes ] logo5 - This is the basic logo image for MATLAB
Files Not In Contents.m. This message appears when a file in the folder is not in Contents.m. These messages are highlighted in gray. Click yes to add the file name and its description line from the M-file help to the Contents.m file.
collatzall is in the folder but not Contents.m collatzall - Plot length of sequence for Collatz problem Add the line shown above? [ yes ]
If you always want the Contents.m file to reflect all files in the current folder, you can automatically generate a new Contents.m file rather than changing the file based on the Contents Report, as follows:
Delete the existing Contents.m file.
Run the Contents Report.
Click yes when prompted for MATLAB to automatically create a Contents Report.
The Dependency Report shows dependencies among M-files in a folder. This is useful for determining:
Which files in the folder are required by other files in the folder
If any files in the current folder will fail if you delete a file
If any called files are missing from the current folder
The report does not list M-files in the toolbox/matlab folder as dependencies because every MATLAB user has those files.
To provide meaningful results, the dependency report requires that the following be true:
The search path when you run the report is the same as when you run the files in the folder. (That is, the current folder is at the top of the search path.)
The files in the folder for which you are running the report do not change the search path or otherwise manipulate it.
The files in the folder do not load variables, or otherwise create name clashes that result in different program elements with the same name.
Select Desktop > Current Folder and navigate to the folder containing the M-files for which you want to produce a Dependency Report.
On the Current Folder browser toolbar, click the Actions button
, and then select Reports > Dependency Report.
The Dependency report opens in the MATLAB Web Browser.
If you want, select one or more options within the report, as follows:
To see a list of all M-files (children) called by each M-file in the folder (parent), select Show child functions.
The report indicates where each child function resides, for example, in a specified toolbox. If a child function's location is listed as unknown, it might be because the child function is not on the search path or in the current folder, or the file may have been moved or deleted.
To list the M-files that call each M-file, select Show parent functions.
The report limits the parent (calling) functions to those in the current folder.
To include subfunctions in the report, select Show subfunctions. Subfunctions are listed directly after the main function and are highlighted in gray.
Click Run Report on Current Folder.

Because the report is a static analysis, it cannot determine run-time data types and, therefore, cannot identify the particular class methods required by an M-file. If multiple class methods match a referenced method, the Dependency Report inserts a question mark link next to the file name, as shown in the following image.

Click the question mark link to see a list of the class methods with the specified name that the MATLAB software might use. MATLAB lists almost all the method files on the search path that match the specified method file (in this case, freqresp.m). Do not be concerned if the list includes methods of classes and MATLAB built-in functions that are unfamiliar to you.
It is not necessary for you to determine which file will be used. MATLAB determines which method to use using the object that the program calls at run time. This list is provided as an indication of the possible toolboxes and method files used.
The following image shows the contents of the right side of the Web browser after you click the question mark link.

The Dependency Report is similar to running the depfun function, although the two do not provide identical results. For performance purposes, the Dependency Report limits the functions considered. Therefore, do not use the Dependency Report to determine which M-files you need to provide when you tell someone to run a particular M-file; instead use the depfun function.
Run the Coverage Report after you run the Profiler to identify how much of a file ran when it was profiled. For example, when you have an if statement in your code, that section might not run during profiling, depending on conditions.
You can view coverage details in the Profiler detail report, or by following these steps:
On the MATLAB desktop, select Desktop > Profiler. Profile an M-file in the Profiler. For detailed instructions, see Profiling for Improving Performance.
Select Desktop > Current Folder and navigate to the folder containing the M-file for which you ran the Profiler.
On the Current
Folder browser toolbar, click the Actions button
, and then select Reports > Coverage Report.
The Coverage Report appears, providing a summary of coverage for the M-file you profiled.
Click the Coverage link to see the Profile Detail Report for the file.

![]() | Tuning and Managing M-Files | M-Lint Code Check Report | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |