Matlab on linux starts from terminal, but not from shortcuts or runners

조회 수: 152 (최근 30일)
I'm using kde neon with ubuntu 20.04 and running matlab, when I open it from a terminal it starts correctly, but when I make a desktop shortcut or run it in any other way, it shows the initial loading screen, but then it closes.
I installed matlab in a different location than /usr/loca/MATLAB I don't know if that would have any effect
  댓글 수: 1
Javier Ossa
Javier Ossa 2023년 11월 5일
편집: Javier Ossa 2023년 11월 5일
Create Matlab Desktop Shortcut Linux UBUNTU
the installed location is :
/usr/local/MATLAB/R2023b/...
Create Matlab Desktop Shortcut Linux using the command:
nano ~/Desktop/Matlab.desktop
Copy-paste the below lines
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=MATLAB
Exec=/usr/local/MATLAB/R2023b/bin/glnxa64/MATLAB
Comment=Matlab R2023b
Icon=/usr/local/MATLAB/R2023b/bin/glnxa64/cef_resources/matlab_icon.png
Terminal=true
Save the Desktop Shortcut file by pressingCtr+X and the type Y followed by the EnterKey.
On the Desktop, right-click on the created file desktop icon “MATLAB.Desktop” and select the “Allow Launching” option.

댓글을 달려면 로그인하십시오.

채택된 답변

Madhav Thakker
Madhav Thakker 2020년 9월 9일
Hi Ian,
I understand that you can launch MATLAB from terminal. Make sure that you can launch MATLAB anywhere on your system by executing “matlab” command in terminal.
If not, you can create a symbolic link for the same. As you have installed MATLAB in a different directory, you can use -
sudo ln -s <YOUR_MATLAB_LOCATION>/bin/matlab /usr/local/bin/matlab
Assuming symbolic link is working, in Ubuntu 20.04 you can make a launcher by copying the desktop file from
/usr/share/applications/matlab.desktop
to
~/.local/share/applications/matlab.desktop
Your matlab.desktop should have a similar structure -
#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Icon=/usr/share/icons/matlab.png
Name=MATLAB R2020a
Comment=Start MATLAB - The Language of Technical Computing
#Uncomment the following line and comment the line after to
#force matlab to use the 32 bits architecture
#Exec=matlab -arch=glnx86 -desktop
Exec=matlab -desktop
Categories=Development;
#Uncomment the following line if you've got several matlab icons in the launcher
#StartupWMClass=com-mathworks-util-PostVMInit
You’ll have to make it executable by running
chmod +x matlab.desktop
You should be able to locate the MATLAB launcher in the dash now.
Hope this helps.

추가 답변 (2개)

Mason
Mason 2022년 9월 18일
편집: Mason 2022년 9월 18일
This works, but personally I had to add one more step. I had to add "-desktop" after my executable line. so it was like "Exec=/my/path/to/matlab/mablab -desktop" like the example provided.
  댓글 수: 1
Javier Ossa
Javier Ossa 2023년 11월 5일
편집: Javier Ossa 2023년 11월 5일
Create Matlab Desktop Shortcut Linux
the installed location is :
/usr/local/MATLAB/R2023b/...
Create Matlab Desktop Shortcut Linux using the command:
nano ~/Desktop/Matlab.desktop
Copy-paste the below lines
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=MATLAB
Exec=/usr/local/MATLAB/R2023b/bin/glnxa64/MATLAB
Comment=Matlab R2023b
Icon=/usr/local/MATLAB/R2023b/bin/glnxa64/cef_resources/matlab_icon.png
Terminal=true
Save the Desktop Shortcut file by pressingCtr+X and the type Y followed by the EnterKey.
On the Desktop, right-click on the created file “MATLAB.Desktop” and select the “Allow Launching” option.

댓글을 달려면 로그인하십시오.


Javier Ossa
Javier Ossa 2023년 11월 5일
for me works like this:
Create Matlab Desktop Shortcut Linux
the installed location is :
/usr/local/MATLAB/R2023b/...
Create Matlab Desktop Shortcut Linux using the command:
nano ~/Desktop/Matlab.desktop
Copy-paste the below lines
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=MATLAB
Exec=/usr/local/MATLAB/R2023b/bin/glnxa64/MATLAB
Comment=Matlab R2023b
Icon=/usr/local/MATLAB/R2023b/bin/glnxa64/cef_resources/matlab_icon.png
Terminal=true
Save the Desktop Shortcut file by pressingCtr+X and the type Y followed by the EnterKey.
On the Desktop, right-click on the created file “MATLAB.Desktop” and select the “Allow Launching” option.
  댓글 수: 3
Chenye Zhou
Chenye Zhou 2024년 1월 20일
If they can create such useless launcher, why not just create the correct launcher by default? Really annoying.
Chenye Zhou
Chenye Zhou 2024년 1월 20일
Matlab is driving me crazy. I created the desktop file but R2023b won't launch and I can only launch it through the terminal. R2022b's libfreetype.so is causing problem.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by