1、在网上自行下载Linux版MATLAB R2024a安装包及破解文件,在安装包路径下新建一个文件夹用于挂载镜像文件,运行以下命令:
mkdir ~/matlab ## 新建文件夹 matlab
sudo mount -o loop R2024a_Linux.iso ~/matlab ## 挂载iso 文件
2、运行以下命令开始安装:
cd ~/matlab
sudo ./install ## 采用sudo权限,后面安装路径需要权限
3、进入安装界面后,点击右上角选项卡选择“I have license...”,然后勾选agreement的“yes”,然后输入安装秘钥,然后选择破解文件中的license.lic文件,选择安装目录,选择自己需要的产品和工具箱,等待完成安装。
4、为方便用户启动MATLAB,建议运行以下命令安装matlab-support,过程中会弹出界面需要输入matlab安装位置和可使用用户(如果不输入指定用户则表示任何用户账号都可用),其他选“yes”和“ok”即可:
sudo apt install matlab-support
5、安装配置完成后,程序列表上应该就有MATLAB选项,接着破解该软件,在破解文件所在路径下运行以下命令:
sudo cp libmwlmgrimpl.so /usr/local/MATLAB/bin/glnxa64/matlab_startup_plugins/lmgrimpl/
6、运行以下命令确保安装MATLAB运行所需要的依赖:
sudo apt-get install libcanberra-gtk-module
7、 若运行软件出现以下英伟达的独显驱动引起的错误:
com.jogamp.opengl.GLException:
X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11,
connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x535b6672, isOwner
false, <15a2f11f, 7c843551>[count 0, qsz 0, owner <NULL>]]]
at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)
at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)
at java.lang.Thread.run(Unknown Source)
Caused by: com.jogamp.opengl.GLException: glXGetConfig(0x1) failed: error code Unknown error code 6
at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.glXGetConfig(X11GLXGraphicsConfiguration.java:570)
at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(X11GLXGraphicsConfiguration.java:500)
at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationXVisual(X11GLXGraphicsConfigurationFactory.java:434)
at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(X11GLXGraphicsConfigurationFactory.java:240)
at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createMutableSurfaceImpl(X11GLXDrawableFactory.java:524)
at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createDummySurfaceImpl(X11GLXDrawableFactory.java:535)
at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:283)
... 2 more
则打开终端依次运行:
cd /usr/local/MATLAB/R2024a/bin
./matlab -softwareopengl
然后打开MATLAB软件命令窗口运行以下命令即可解决:
opengl(‘save’,’software’)
8、解决Ubuntu高分辨率显示器下MATLAB工具栏字体显示过小的问题,在MATLAB软件命令窗口运行:
s = settings;
s.matlab.desktop.DisplayScaleFactor;
s.matlab.desktop.DisplayScaleFactor.PersonalValue = 1.5; ## 1.5是放大尺度,根据需要自行设置
然后重启软件即可。