Loren on the Art of MATLAB

Turn ideas into MATLAB


Loren on the Art of MATLAB has been archived and will not be updated.

Editor Features in R2010b

There are a couple of features available in the editor in R2010b that I take full advantage of. Variable highlighting is one, and comment wrapping is the second.


Variable Highlighting

There are two aspects to variable highlighting that are available in the editor in R2010b. The first is that if you select a variable, all other instances of that variable get highlighted and a summary of the usage appears in the status bar and the lines where these appear show up on the information bar on the right-hand side (where code analyzer messages also appear).

The other highlights that you can see are for nonlocal variables, i.e., variables shared between a parent function and a function nested in it.

You can turn these highlights on and off and change the highlight colors in the MATLAB preferences. Mike talks more about variable highlighting in this post, as well as showing pictures.

Comment Wrapping

Since I produce my blog by writing MATLAB code in the editor, I find myself frequently editing and having some lines very long, and some unnecessarily short. I used to have to select an entire region and rewrap the comments. Now I only have to have my cursor in that region, and with the stroke of Ctrl-J, I get them nicely wrapped. Jared talks more about this in his first post.

In his second post, Jared talks more working with indented code and wrapping associated comments. In addition, block comments now wrap appropriately as well.


Any comments on managing comments in MATLAB code? Let me know here.

Published with MATLAB® 7.11

  • print


要发表评论,请点击 此处 登录到您的 MathWorks 帐户或创建一个新帐户。