Mike on the MATLAB Desktop

June 29th, 2009

What does your MATLAB Desktop look like? (again)

Way back in May of 2007, we asked you what your MATLAB Desktops’ looked like. Well, we want to ask you again, but this time Mike and I would also like to ask why your desktop is the way it is. Also, this time we’re offering up free t-shirts to the first 3 thoughtful respondents.

Mike and I will gather up all the screen shots and explanations you send in, and then post a blog with all that good info next week.

Here’s what we’d like to know from you, which you can email to us at desktop_blog_feedback@mathworks.com:

  1. Your name as you’d like it to appear in the blog post (feel free to leave this blank).
  2. What version of MATLAB you’re using?
  3. A screen shot of your MATLAB Desktop (PNG preferred). Feel free to include multiple shots, and no need to scale them dow — we’ll take care of that.
  4. A paragraph or two about why you’ve setup your desktop the way it is.
  5. What your favorite feature of the actual desktop itself is (e.g. docking, tiling)?

Here are Mike and my responses:

Mike Katz, using 7.8 (R009a)

I destroy my preferences directory on a regular basis so I often keep coming back to the default layout introduced in R2008b. I’ve been keeping my editor docked in the middle since we first introduced that capability. I change the division of editor/command window depending if I’m in code writing or debugging mode. I often use the Command history for rerunning code, especially from previous sessions.

I like the shortcuts. Normally I keep about 12 items on there that set up certain projects or provide utility like formatting a string in the clipboard for pasting into this blog…

Ken Orr, using 7.8 (R009a)

The Editor is usually the focus of my work, so it gets the most space on the upper right of my desktop. I usually have a number of files open, so I’ve moved the tabs over to the right hand side, which lets them run vertically. I usually leave the workspace browser closed, as I don’t need it when writing MATLAB code. Also, I don’t use the Command History, so I leave that closed too.

I like being able to move my tabs around the Editor.

18 Responses to “What does your MATLAB Desktop look like? (again)”

  1. Brett Shoelson replied on :

    Hey, Ken. I have several layouts, and I toggle between them depending on what I’m working on. When I’m playing with images (which is much of the time), I like to give my editor and my figure window prominence. Everything is docked. My Editor and Help windows are stacked; my Workspace Browser, Command History, and Current Directory Browswer are stacked and given little space; and my Figure Window is docked on the top left. That gives me a good way to interact with the images.
    Cheers,
    Brett
    Brett

  2. Christian Peel replied on :

    The only thing that I have Matlab display is the command window. I edit in emacs or xemacs via emacslink, and also use that interface for debugging. Obviously I don’t use R2009a, since emacslink has been disabled in that release; I use 2008a.

    You’ve made vague hints in the past about the possibility of scripting the editor; an API or a powerful utility for editor keybindings and macros is even more essential now that you’re dropping emacslink. If I’m to ever use the Matlab edtior, I’d like customizable keybindings for opening files, switching tabs, and every possible thing one could do in the Matlab editor. I don’t want to be required to take my hands off of the keyboard when I’m editing and debugging.

    Chris

  3. Christian Peel replied on :

    BTW, my favorite feature up until now has been emacsLink.

  4. Ken replied on :

    Hi Christian,

    That’s pretty hard-core (I mean that in a most positive way)!

    Your observations are astute… I encourage you to keep reading this blog, where we’ll break feature news first!

    -Ken

  5. yash replied on :

    Hello,

    I was wondering if it is possible to get new figures docked inside the figures “window” automatically.
    I usually run into this problem when I try to plot new figure from an m-file.

    Thanks,
    Yash

  6. Jackson Shen replied on :

    Hi Yask,

    Add the following code in “startup.m” located in “C:\MATLAB\R2008a\toolbox\local”:
    set(0,’DefaultFigureWindowStyle’,'docked’);

    However, when you are using GUIDE, you might want to switch back to normal mannually.

    Regards,

  7. Kelly replied on :

    In what version was the ability to move the document bar to the right introduced? I often have up to a dozen files open at once, so that would be a nice feature to have. Whenever I need to edit a large number of related files, I switch over to Textmate as an editor, since it allows me to view and jump between files a bit more intuitively. Being able to view a directory tree of files like in Textmate would be a very nice addition to the Matlab editor, maybe even enough to get me to upgrade from R2007a.

  8. Kevin replied on :

    Hey Ken,

    I dual monitor my desktop so I typically have the Matlab editor undocked and taking up the main monitor. On the 2nd monitor I have the Variable Editor and the workspace taking up the upper half of the desktop and the command window and command history on the bottom. I use the variable editor and workspace to dubug a lot of my code and see what exactly is going on with the variables. After reading a prior post I’m going to look into docking the Matlab help, I think that would be very convenient. I’m using MATLAB 7.8 R2009a.

  9. Yair Altman replied on :

    @Christian et al - I have now uploaded to the File Exchange a utility called EditorMacro, which enables assigning keyboard macros in the editor: http://www.mathworks.com/matlabcentral/fileexchange/24615

    A technical description of the solution underlying this utility can be found here: http://UndocumentedMatlab.com/blog/EditorMacro/

    Note that this utility, although tested for Matlab versions 6.0 (R12) through 7.7 (R2008b), relies on undocumented and unsupported Matlab functionality which may break in future Matlab releases.

    Feedback welcome
    enjoy :-)

    Yair

  10. Ken replied on :

    @Kelly,

    You can move the document bar to the right (or left or top) in R2007a. Note that you can easily jump between files in the MATLAB Editor by using the Open Selection from the context menu (Ctrl+D via the keyboard on Windows or Shift+Cmd+D on the Mac).

    -Ken

  11. yash replied on :

    Thank you Jackson.

  12. Ken replied on :

    @Kevin,

    Sounds like a nice setup. We’d love to see screen shots (you can email us at desktop_blog_feedback@mathworks.com if you’d like to share).

    -Ken

  13. Ustun Ozgur replied on :

    I use KDE as my window manager on Linux. I use multiple desktops, and each different application resides in a different desktop.

    I keep only MATLAB on Desktop 3 for example, so to switch to MATLAB application, I just press Ctrl-F3. To switch to another application, web browser, for example, I switch to the first desktop etc. So, I rarely need to use Alt-Tab, and that way, I can be sure that I will switch to MATLAB when I press Ctrl-F3.

    I use two monitors, a 22′ LCD and a 17′ CRT. I keep the Command window on the right monitor, maximized; and the editor window on the left monitor, again maximized. I don’t use Workspace, Current Directory etc. I sometimes go full screen to get even more space, using Alt-F11 in KDE.

    I use the window switching shortcuts a lot (Ctrl-0 for command window, Ctrl-Shift-0 for the editor, Ctrl-4 for the doc). I usually use common commands like cd, pwd to navigate through directories, and use the edit command extensively to open files, rather than rely on the GUI. Sometimes I have several files, and rather than trying to select the correct file from the tab bar, I simply type ‘edit filename.m’ to switch to it. (Actually, I rarely type that whole thing thanks to auto completion by the up arrow key, I usually simply type ‘ed’ and then press Up.) To open a particular file in which I remember which variable was used, I use a function ‘g’ to search for that variable, it finds the file using ‘grep’ in File Exchange, and I simply click the hyperlink to open the file in the Editor.

    The g function is below. I use the grep created by us here ( http://www.mathworks.com/matlabcentral/fileexchange/9647 ) but made the following modifications to ignore case by default, and print line numbers by default:
    ———–
    Change line 84 from
    ‘-i’ true 0 [] 0 ‘ignore case’
    Change line 89 from
    ‘-n’ true 0 [] 0 ‘print line number’
    ———–

    function g(string,r)
    % Searches for the string in m files
    % Usage:
    % "g snr" searches for snr in the current dir
    % "g snr 1" searches for snr in the current dir and subdirs
    
    if ~exist('r'), r = 0; end
    if r
        grep('-r', string,'*.m')
    else
        grep(string,'*.m')
    end
    

    I use emacs-style keybindings, and smarttab. Other than these, I have some shortcuts, but use them rarely. I use emacs when I’m not programming a GUI, and when I don’t debug.

    One last tip for KDE users is that when I press F1 to read documentation in command window, Alt-F5 which maximizes the window works for that little documentation window, so I don’t have to switch to Doc viewer, or I can view two Docs simultaneously.

  14. Mike replied on :

    Ustun,

    Thanks! That is some good information and great tips. When you get your hands on MATLAB R2009b, try docking the help browser to see if that enhances your layout.

  15. Matt Fig replied on :

    “Way back in May of 2007, we asked you what your MATLAB Desktops’ looked like. Well, we want to ask you again, but this time Mike and I would also like to ask why your desktop is the way it is. Also, this time we’re offering up free t-shirts to the first 3 thoughtful respondents.

    Mike and I will gather up all the screen shots and explanations you send in, and then post a blog with all that good info next week.”

    I cannot be the only one who emailed you guys a screenshot! “next week” …?…

  16. Ken replied on :

    Hi Matt,

    Due to a not-so-great response, I’ve yet to get three screen shots and narratives. So… there are t-shirts available to the next couple of people who send their info in!

    -Ken

  17. Ken replied on :

    @Matt,

    By the way, we never received your screenshots and narrative. Try sending them again.

    desktop_blog_feedback@mathworks.com

    -Ken

  18. Matt Fig replied on :

    Ken,

    I sent it again from the email address through which you contacted me. Hope it works this time! Maybe others got spam-binned too.

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).


Mike works on the MATLAB Desktop team.
  • Craig Warren: I’m using R2009b and Mac OS X 10.6.2, and mounting a Samba share. The share contained some (as it...
  • Steve Eddins: OysterEngineer&mdash ;Pestering accomplished. Thanks.
  • OysterEngineer: The Blogs link from the MatLab Central web page still calls it Ken & Mike. Maybe you can pester...
  • Chris: Pavi and Jerry, could you provide some examples of situations in which you preferred to use the index tab? We...
  • Jerry: The removal of index tab is very very inconvenient. Search is good but Index has its own position. I want it...
  • Mike: @Jason, That functionality is not available yet in the new version of uitable. Setting the columnWidth to auto...
  • Mike: @Jonas, We try to use native or native-like dialogs wherever we can. There are technical limitations on why...
  • Mike: @Sung, If your personal settings are set by a startup.m you can specify in the Windows shortcut which folder...
  • Jonas: On Macs, uigetfile and uigetdir apparently call different versions of file pickers: only with uigetdir does...
  • Jason: Yet another request for VI/VIM bindings. Muscle memory is a powerful thing to overcome, which is why I still...

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