Add Reminders to Files

Annotating a file makes it easier to find areas of your code that you intend to improve, complete, or update later.

To annotate a file, add comments with the text TODO, FIXME, or a string of your choosing.

After you annotate several files, run the TODO/FIXME Report, to identify all the MATLAB® code files within a given folder that you have annotated.

This sample TODO/FIXME Report shows files containing the strings TODO, FIXME, and NOTE. The search is case insensitive.

Working with TODO/FIXME Reports

  1. Use the Current Folder browser to navigate to the folder containing the files for which you want to produce a TODO/FIXME report.

      Note:   You cannot run reports when the path is a UNC (Universal Naming Convention) path; that is, a path that starts with \\. Instead, use an actual hard drive on your system, or a mapped network drive.

  2. On the Current Folder browser, click , and then select Reports > TODO/FIXME Report.

    The TODO/FIXME Report opens in the MATLAB Web Browser.

  3. 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 can enter NOTE, tbd, or re.*check.

  4. Run the report on the files in the current folder, by clicking Rerun This Report.

    The window refreshes and lists all lines in the MATLAB files 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 report window, change the current folder. Then, click Run Report on Current Folder.

To open a file in the Editor at a specific line, click the line number in the report. Then you can change the file, as needed.

Suppose you have a file, area.m, in the current folder. The code for area.m appears 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 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 that you select the text field.

Was this topic helpful?