Ken & Mike on the MATLAB Desktop

March 17th, 2008

What’s on my TODO list?

Oftentimes in the course of coding, I find myself with little bits that I don’t want to deal with right away–things that I would like to come back to them later. Like most IDEs, MATLAB allows you to drop annotations which indicate things to do, fix, or otherwise note for later.

By adding a comment with the text: “TODO” or “FIXME” in a MATLAB file, you automatically sign up for this feature. You can then use the TODO/FIXME report to scan all the files in a given directory for these tags, which presents the results to you in the web browser.

You can get to this report using the directory reports-drop down in the Current Directory Browser:

TODO/FIXME report in Directory Reports drop-down

Clicking on the TODO/FIXME report button will cause MATLAB to scan all the files in the current directory, and display each line in the files that have one of the keywords. For example, in my directory I have two files with applicable markers:

TODO/FIXME report in Directory Reports drop-down

You’ll notice that the report also picked up a line with a “NOTE” in it. As an added bonus, we can find up to one additional comment tag, “NOTE” by default, but you can enter whatever regular expression you desire. To specify your own custom tag, replace the text in the text field that reads “NOTE” in the TODO/FIXME report web page (see above screen shot) with your own regular expression.

In general, I recommend using these comments as quick reminders for changes you really, really will work on in the near future. I’ve found such notes lose meaning when viewed by others or even yourself when revisiting the code after it is no longer fresh.

One Response to “What’s on my TODO list?”

  1. Oliver A. Chapman, P.E. replied on :

    A few months ago, I attempted to use this feature for the first time, but couldn’t remember what the key word was to make a “To Do” or “Fix Me” entry. I spent ~20 minutes surfing the documentation and found good documentation about how to generate the report, after I had populated the code with the appropriate key words followed by my meaningful text.

    I called your technical support and it took them ~10 minutes to answer it.

    I’ve just glanced at the help system and it appears that this release retains that poor documentation about how to actually make a “To Do” entry. Am I right?

Leave a Reply

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>

If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).


Ken & Mike work on the MATLAB Desktop team.
  • DP: Hi i have a problem with ezplot3, i want to plot more than i curve in the same graph but hold on command...
  • Ken: Hi Arsalan, Unfortunately there is no way to get the new Editor API in older versions of MATLAB. -Ken
  • Arsalan: Hi, I am very excited about the MATLAB API for editor because right now i am working on a project and i need...
  • Johannes: Since I started using matlab-emacs some days ago I never experienced Emacslink. But I experienced some...
  • Francisco J. Beron-Vera: Hi all, I have recently learned about ViEmu (http://www.vimemu.c om) which, for Vi/Vim...
  • OysterEngineer: When I first learned of the Publish feature in MatLab, I thought it might be useful to help to...
  • Ken: Hi Herve, I’m not quite sure what you mean by “stand-alone&# 8221; mode? -Ken
  • Herve: I wonder when the publish fonction will be supported in standalone mode.
  • Mike: Ravi, What you described should work as far I understand it. Please follow up with technical support. With a...
  • Mike: @Daniel, Thanks for that note.

These postings are the author's and don't necessarily represent the opinions of The MathWorks.