File Exchange Pick of the Week

Our best user submissions

Navigating Made Easy

Posted by Jiro Doke,

Jiro‘s pick this week is easyBrowser by Michele Scalseggi.

When I work on a large project, I usually have files scattered across multiple directories with many files open at once in the Editor. Being able to quickly navigate through the files and directories becomes really important from an efficiency point of view. Some of the Editor features I can’t live without are

  • “Open file” context menu. I usually use the shortcut “Control-D”.

  • “Change directory” context menu from the file list tab.

  • Auto-highlighting of variable names. I then use Alt-<arrow key> to jump to the other occurrences of the variable.

Michele’s easyBrowser provides a few other nice-to-have utilities when you are developing code in MATLAB. One of my favorites is the nav function. Michele also calls it out as the “most useful” in his collection. nav allows you to add directories and MATLAB files to your “favorites”. Then you can easily jump to the directory (or open the file in the Editor) via hyperlink.

Here are some of the other reasons I like this entry:

  • Plenty of help. Michele includes detailed help for each file, along with an example file.
  • setpref and getpref to manage the favorites. This is a nice way to manage user settings that persist across MATLAB sessions.
  • OS-independent. He has a function that opens the working directory in the system explorer. There is a convenient function winopen that opens files/directories in Windows, but it doesn’t work on Macs or Unix systems. Michele makes sure that his function works on all platforms by checking the OS.

I have one enhancement request. Michele has a folder called “Internals” where he puts all internal functions that are used only within his functions. But since this is a regular folder (and on the path), there’s nothing preventing users or other functions from accidentally calling those internal functions. If they are meant only for internal use, I suggest making them private functions (put them in a folder called “private”) or making them packages (put them in a folder that starts with “+”).

Comments

Give it a try and let us know what you think here or leave a comment for Michele.


Get the MATLAB code

Published with MATLAB® R2017a

Note

Comments are closed.