试了网上的方法:
我在Ubuntu下是用的默认安装的,路径为/usr/local/MATLAB/R2010b
sudo gedit /usr/share/applications/Matlab.desktop
写入以下内容
[Desktop Entry]
Type=Application
Name=Matlab
GenericName=Matlab 2010b
Comment=Matlab:The Language of Technical Computing
Exec=sh /usr/local/MATLAB/R2010b/bin/matlab -desktop
Icon=/usr/local/MATLAB/Matlab.png
Terminal=false
Categories=Development;Matlab;
图片
Ubuntu下给Matlab 建立快捷方式
图片为png格式,是透明背景的哦,Linux可不像Windows,是支持透明背景的,貌似任何不太大的图片都可以作为图标使用。
这样,你就可以在左上角的Application菜单中的Office目录下找到Matlab啦。
你还可以在顶栏条处点右键选择”增加到面板“,然后选择“载入程序“,在Office目录下选择Matlab。Matlab的快捷方式就出现在顶栏啦!
然而并不行....
请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
版面规则
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
我们都知道新人的确很菜,也喜欢抱怨,并且带有浓厚的Windows习惯,但既然在这里询问,我们就应该有责任帮助他们解决问题,而不是直接泼冷水、简单的否定或发表对解决问题没有任何帮助的帖子。乐于分享,以人为本,这正是Ubuntu的精神所在。
-
- 帖子: 12
- 注册时间: 2016-02-29 21:25
- 系统: win8+ubuntu
- vickycq
- 帖子: 4507
- 注册时间: 2011-03-20 13:12
- 系统: Debian
- 来自: 山东省寿光县
- 联系:
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
首先确认能否从终端正确启动 /usr/local/MATLAB/R2010b/bin/matlab
其次将 /usr/local/MATLAB/R2010b/bin/ 加入 PATH
其次在 desktop 文件中设置正确的 StartupWMClass
可能为 StartupWMClass=com-mathworks-util-PostVMInit
或 StartupWMClass=sun-awt-X11-XFramePeer
例如
参考 http://askubuntu.com/questions/139352/h ... -for-unity
其次将 /usr/local/MATLAB/R2010b/bin/ 加入 PATH
其次在 desktop 文件中设置正确的 StartupWMClass
可能为 StartupWMClass=com-mathworks-util-PostVMInit
或 StartupWMClass=sun-awt-X11-XFramePeer
例如
代码: 全选
[Desktop Entry]
Version=1.0
Type=Application
Icon=/usr/local/MATLAB/Matlab.png
Name=Matlab
Comment=Start MATLAB - The Language of Technical Computing
Exec=/usr/local/MATLAB/R2010b/bin/matlab -desktop
Terminal=false
Categories=Development;
StartupNotify=true
StartupWMClass=com-mathworks-util-PostVMInit
X-Ayatana-Desktop-Shortcuts=New_Window;
[New_Window Shortcut Group]
Name=New Matlab
Exec=/usr/local/MATLAB/R2010b/bin/matlab -desktop
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
欢迎所有 Debian GNU/Linux 用户
-
- 帖子: 12
- 注册时间: 2016-02-29 21:25
- 系统: win8+ubuntu
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
[quote="vickycq"]首先确认能否从终端正确启动 /usr/local/MATLAB/R2010b/bin/matlab
其次将 /usr/local/MATLAB/R2010b/bin/ 加入 PATH
请问:加入PATH是什么意思阿?
其次将 /usr/local/MATLAB/R2010b/bin/ 加入 PATH
请问:加入PATH是什么意思阿?
- vickycq
- 帖子: 4507
- 注册时间: 2011-03-20 13:12
- 系统: Debian
- 来自: 山东省寿光县
- 联系:
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
PATH 是可执行文件搜索路径。默认类似这样:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binjx9807 写了:请问:加入PATH是什么意思阿?
我们希望它变成这样:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/MATLAB/R2010b/bin
创建 /etc/profile.d/matlab.sh 加入以下内容
代码: 全选
export PATH="$PATH:/usr/local/MATLAB/R2010b/bin"
代码: 全选
sudo chmod a+x /etc/profile.d/matlab.sh
参考 https://en.wikipedia.org/wiki/PATH_(variable)
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
欢迎所有 Debian GNU/Linux 用户
-
- 帖子: 12
- 注册时间: 2016-02-29 21:25
- 系统: win8+ubuntu
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
PATH 是可执行文件搜索路径。默认类似这样:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/binvickycq 写了:jx9807 写了:请问:加入PATH是什么意思阿?
我们希望它变成这样:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/MATLAB/R2010b/bin
创建 /etc/profile.d/matlab.sh 加入以下内容
代码: 全选
export PATH="$PATH:/usr/local/MATLAB/R2010b/bin"
代码: 全选
sudo chmod a+x /etc/profile.d/matlab.sh
结果是这样还是不行:
xiaohao@jx-Aspire-E1-471G:~$ export PATH='$PATH:/home/xiaohao/Documents/matlab2015b/bin"
>
> > sudo chmod a+x /etc/profile.d/matlab.sh
>
如果可以的话,/usr/share/applications里的matlab.desktop应该是直接可以双击打开的吧?
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
https://help.ubuntu.com/community/Unity ... sktopFiles如果可以的话,/usr/share/applications里的matlab.desktop应该是直接可以双击打开的吧?
UnityLaunchersAndDesktopFiles
-
- 帖子: 12
- 注册时间: 2016-02-29 21:25
- 系统: win8+ubuntu
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
poloshiao 写了:https://help.ubuntu.com/community/Unity ... sktopFiles如果可以的话,/usr/share/applications里的matlab.desktop应该是直接可以双击打开的吧?
UnityLaunchersAndDesktopFiles
不太明白这句话是干什么:“One last thing to add is that by setting executable rights to your .desktop file,”
- vickycq
- 帖子: 4507
- 注册时间: 2011-03-20 13:12
- 系统: Debian
- 来自: 山东省寿光县
- 联系:
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
事实上,将自行创建的 .desktop 文件置于 /usr/share/applications 中,所有者为 root,不需要可执行权限不太明白这句话是干什么:“One last thing to add is that by setting executable rights to your .desktop file,”
能否描述一下“不行”的具体现象?然而并不行....
Matlab 有无出现在 Unity Laucher 中?单击能否打开?
到 /usr/share/applications 中双击 Matlab.desktop 能否执行?
将 /usr/share/applications/Matlab.desktop 中对应项改为
代码: 全选
Exec=/usr/local/MATLAB/R2010b/bin/matlab
Terminal=true
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户
欢迎所有 Debian GNU/Linux 用户
-
- 论坛版主
- 帖子: 18279
- 注册时间: 2009-08-04 16:33
Re: 请问ubuntu14.04怎么给装好的Matlab创建快捷方式?
0. 確認 /usr/local/MATLAB/R2010b/bin/matlab 可執行屬性viewtopic.php?p=3157174#p3157174
sudo gedit /usr/share/applications/Matlab.desktop
Exec=sh /usr/local/MATLAB/R2010b/bin/matlab -desktop
sudo chmod +x /usr/local/MATLAB/R2010b/bin/matlab
試試
1. Exec=/usr/local/MATLAB/R2010b/bin/matlab -desktop
或
2. Exec=matlab -desktop
但是 把
PATH=$PATH:/usr/local/MATLAB/R2012a/bin
加到
~/.profile
參閱
3. https://help.ubuntu.com/community/MATLA ... ot_in_path
Matlab executable not in path
4. https://specifications.freedesktop.org/ ... 01s06.html
The Exec key
The executable program can either be specified with its full path or with the name of the executable only.