Loren on the Art of MATLAB

Turn ideas into MATLAB

Note

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.

Contents

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.

Comments?

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




Published with MATLAB® 7.11


  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.