Matlab from the Ubuntu Menu

Getting stuff to work from the Ubuntu Menu is pretty straightforward, but I ran into some little problems that confused me with Matlab. This post goes through the steps and difficulties I had, which might be useful in general, not just in relation to Matlab.

First up, I installed the Student Edition of Matlab (currently R2009a and a steal at the student price), taking into account the fact that I’m running a 64-bit OS and the student edition doesn’t come with the 64-bit architecture libraries. Pretty confusing on first install as the installer detects the architecture but then can’t find the libs, but corrected using this guidance on the Mathworks website.

Once you’ve done that, you need to pass the argument ‘-glnx86′ to Matlab every time you start it up.

That’s a pain, plus the other boilerplate to run it in the background – so I tried to set up a menu option using ‘Main Menu’, which is the relevant administrative tool that comes with Ubuntu. It’s in System – Preferences – Main Menu if you’ve not used it before. Here’s a screenshot of it, set up with a Matlab launcher.


Main Menu with Matlab

The obvious thing is to give Main Menu the command that works from the command prompt, but no. Doing this results is strange behaviour where the splash screen fires up, disappears, and nothing. Checking the .xsession-errors log file in my home directory shows what’s happening. The application is launching in command line mode, writing its prompt to stdout, and then being shut down.

Kinda weird, maybe, as launching the app from the command line launches the Matlab GUI. Anyway, you also need to also add a ‘-desktop’ argument to the launcher command. My Matlab is installed in /opt/matlab, remember to change the path as appropriate for you.


The Matlab Launcher

You can also add the icon if you want by clicking where the Matlab icon is shown above, browsing to wherever you installed Matlab then into the ‘X11/icons’ directory, where you’ll find a number of icons.

Now you can launch the program from Main Menu, or drag-dropping it onto a panel, onto your desktop – wherever you like.

These are my thoughts and opinions and do not reflect those of anyone else. Read the disclaimer for more verbal teflon.
Posted on September 28, 2009 at 8:56 pm by Paul Brabban · Permalink
In: matlab, Ubuntu · Tagged with: ,

7 Responses

Subscribe to comments via RSS

  1. [...] If you are using the Student version of MATLAB then the process is slightly different and has been covered by my friend Paul Brabban over at CrossedStreams.com. [...]

  2. Written by Dafydd
    on December 7, 2009 at 3:14 pm
    Permalink

    Thanks, great help

  3. Written by Feruz
    on February 1, 2010 at 7:58 pm
    Permalink

    Good job, Thanks…

  4. Written by jime
    on May 10, 2010 at 5:02 pm
    Permalink

    Thanks! The “disappearing Matlab” issue was driving me crazy.

  5. Written by Don Levin
    on July 11, 2010 at 10:57 pm
    Permalink

    Installing matlab 2010a on ubuntu 10.04 desktop, I didn’t know there were instructions, so I just put in the cd and ran the install program. After install it wouldn’t run in a terminal window. I tried creating the menu app, but it “disappeared”. I added -desktop like you suggested, and … it works! Thanks very much.

  6. Written by Hossein
    on October 5, 2011 at 2:11 pm
    Permalink

    Thank you. You save me :)

  7. Written by Keith
    on January 5, 2012 at 6:48 pm
    Permalink

    Works on Ubuntu 11.10 64-bit with MATLAB 2011a, thank you!

Subscribe to comments via RSS

Leave a Reply