6

I've installed MATLAB R2011a on Ubuntu 11.10 today following Ubuntu's guide.

I've also followed the steps to create the launcher. It appeared, but when I click on it nothing happens. Does anyone knows what can I do to fix it?

Additional info

I can run it perfectly through terminal. My only problem is getting the launcher to work.
To create the launcher I used these instructions:

  1. Get an icon:

     sudo wget http://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png -O /usr/share/icons/matlab.png
    
  2. Get the launcher file:

     sudo wget 'https://help.ubuntu.com/community/MATLAB?action=AttachFile&do=get&target=matlab-r2011a.desktop' -O /usr/share/applications/matlab.desktop
    
2
  • How did you create the launcher? Also can you confirm that you can launch matlab from a terminal?
    – jmetz
    Aug 4, 2012 at 21:02
  • I can run it perfectly trough terminal. My only problem is getting the launcher to work. To create the launcher I used the instructions on <help.ubuntu.com/community/MATLAB#Create_A_MATLAB_Launcher> I added the info you requested on the original message.
    – Daniel
    Aug 4, 2012 at 21:48

3 Answers 3

7

Try specifying the full path in the launcher you are using.

So for example if the output of which matlab is /usr/bin/matlab, then change the Exec field to

Exec=/usr/bin/matlab -desktop

Note that if this does solve the issue for you it's likely because you have a script called matlab that is shadowing the original matlab command and so perhaps matlab is not receiving the -desktop flag which it needs to run when launched without a terminal.

See this entry for more details about getting the launcher to start properly by using -desktop.

If for some reason you still get nothing, try setting the type field to terminal application to diagnose the problem further.

2
  • I went to /usr/share/applications, right clicket on matlab and tried to change the execute command, without success. Everytime I closed it it returned to the defauld. Is there any way to do it using the terminal?
    – Daniel
    Aug 4, 2012 at 22:15
  • @Daniel: you need to do it as root. You can do this eg, using sudo gedit /usr/share/applications/matlab.desktop from a terminal (or using whatever other text editor you prefer)
    – jmetz
    Aug 4, 2012 at 23:03
3

I had this same problem and many of the fixes I found didn't work. Here was the solution I finally came to using Ubuntu 14.04 with MATLAB 2016a.

MATLAB opens from the terminal fine, so find out what is being called for that command:

> which matlab
/usr/local/bin/matlab

Then to actually create the icon, I just launched MATLAB from the terminal

> matlab

and when the icon appeared in the launcher, I right clicked on it and clicked 'Lock to Launcher'. Here is where my solution diverged from a lot of the other solutions. Instead creating a .desktop file in /usr/local/applications, I actually had to modify the one that was created in ~/.local/share/applications

> gedit ~/.local/share/applications/matlab_r2016a.desktop

and modified the file to

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Name=MATLAB R2016a
Icon=matlab_r2016a.png
Path=/home/username
Exec=/usr/local/bin/matlab -desktop
StartupNotify=true
StartupWMClass=MATLAB R2016a
OnlyShowIn=Unity;
X-UnityGenerated=true

where the Path points to your home directory and the Exec is whatever which matlab returned plus the flag -desktop

1
  • 1
    I'll note that I'm still having problems with the launcher-based MATLAB, though. It does not recognize environment variables from .bashrc, where is a MATLAB session launched from a terminal does
    – Ross Allen
    Aug 4, 2016 at 16:11
0

I suggest to get the command described in Exec tag, inside /usr/share/applications/matlab.desktop file, or equivalent, and try it on the command line. It probably will show an error message!

I found a message like:

/usr/local/MATLAB/R2018a/bin/glnxa64/MATLAB: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version
`GLIBCXX_3.4.22' not found (required by /usr/local/MATLAB/R2018a/bin/glnxa64/libCppMicroServices.so.3.1.1) 

You can try to update the libraries with the commands:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.9
sudo apt-get upgrade libstdc++6

After that try again! Source:MATLAB displaying erroneous message during launching

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .