Skip to Main Content Skip to Search
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Inside the MATLAB Desktop

April 28th, 2008

Code Folding Update in R2008a

We heard your requests, and have added 12 more foldable constructs, including full support for the new MATLAB class system. We introduced code folding back in R2007b (check out the blog entry on it here), and quickly heard that folding only functions and function help was not enough. This is a great example of how your feedback really can affect things.

All these new foldable constructs can really help to hide detail that you may not always need to see (possibly the internals of a switch/case block). This is especially useful if your working on two non-contiguous areas in a file. Normally, this would require lots of scrolling, but with code folding, you can just collapse all the constructs between the two areas (you could also use split screen, but I prefer the folding technique).

Here’s a look at edit.m, the same file Christina showed back in November 2007, only now there are a lot more foldable regions:

Code folding preferences

And the new code folding preferences page:

Code folding preferences

Just as with the original two foldable constructs, you can choose which constructs you’d like to be folded by default. So if you want switch/case blocks to be folded whenever you open a file, select Fold Initially next to Switch/case blocks in the Editor/Debugger -> Code Folding preferences pane.

Also note that once you’ve opened a a file and tweaked what’s folded and what’s expanded, the MATLAB Editor will remember the fold state of that file even after you’ve closed it. So the next time you open your file, everything will be just as you left it.

If there are things you think should be foldable, that we’re not folding, leave us a comment here.

Leave a Reply


Inside the MATLAB Desktop is written by the MATLAB Interface teams.

Team picture
  • Mike: Thanks Quan!
  • Quan: That’s a cool feature for the see also command. I just got the chance to check my google reader today,...
  • Mike: Harsha, On Windows, I use SnagIt to do the screen caps and annotations. Unfortunately its do not look so nice,...
  • Harsha: I would like to know how you got this kind of border for screenshots?
  • Mike: @Daniel, What are the keyboard shortcuts you use most often? What operations do wish there were shortcuts for?
  • Biswanath Senapati: I am using MATLAB tool for our work. Now I want to integrate matlab desktop (command window) in...
  • Ken: Hi John, I can appreciate your desire for a true Mac user interface. As a Mac user myself, I am constantly...
  • John Haitas: 7 years on… still no native graphics for the Mac. When will Mathworks take time to code a GUI...
  • Ken: Hi Daniel, Your absolutely right - keyboard shortcuts in MATLAB is an area that could use some improvement. Good...
  • Daniel Armyr: Hi. I am one of those old-school people who feels that the command-line has definate merit. However,...

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

Related Topics