下载安装镜像和破解包
安装包存放目录/opt/package,软件安装目录/opt
准备好破解包
#进入安装包目录 cd /opt/package #解压破解包 unzip Crack.zip
安装
#进入安装目录 cd /opt #创建挂载点 mkdir matlab #挂载第一块镜像 mount -t auto -o loop package/MatlabR2018b_LinX64_disk1.iso matlab/ #复制出activate.ini备用 cp matlab/activate.ini . #复制出installer_input.txt文件备用 cp matlab/installer_input.txt . #执行安装命令(命令参数可参考拷贝出的installer_input.txt文件,安装密钥可参考Crack包里面的Readme.txt文档) ./matlab/install -fileInstallationKey 09806-07443-53955-64350-21751-41297 -agreeToLicense yes -mode silent -destinationFolder /opt/MATLAB/R2018b #镜像1安装完之后弹出镜像1的挂载点 umount matlab/ #挂载第二块镜像 mount -o loop package/MatlabR2018b_LinX64_disk2.iso matlab/
#镜像2安装完之后弹出镜像2的挂载点
umount matlab/
激活
#编辑激活文件 vim activate.ini isSilent=true activateCommand=activateOffline licenseFile=/opt/package/Crack/license_standalone.lic activationKey=09806-07443-53955-64350-21751-41297 #执行激活 MATLAB/R2018b/bin/activate_matlab.sh -propertiesFile activate.ini #覆盖破解文件 cp package/Crack/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so MATLAB/R2018b/bin/glnxa64/matlab_startup_plugins/lmgrimpl/libmwlmgrimpl.so
配置环境变量
#打开环境变量配置文件 vim /etc/profile #在配置文件底部添加matlab环境变量 #set matlab environment export PATH=$PATH:/opt/MATLAB/R2018b/bin #使新配置的环境变量生效 source /etc/profile
安装完成
[root@localhost opt]# matlab MATLAB is selecting SOFTWARE OPENGL rendering. < M A T L A B (R) > Copyright 1984-2018 The MathWorks, Inc. R2018b (9.5.0.944444) 64-bit (glnxa64) August 28, 2018 To get started, type doc. For product information, visit www.mathworks.com. >>
可能遇到的问题
[root@localhost opt]# matlab MATLAB is selecting SOFTWARE OPENGL rendering. Fatal Internal Error: Unexpected exception: 'N9MathWorks6System15SimpleExceptionE: Dynamic exception type: std::runtime_error std::exception::what: Bundle#3 start failed: libXt.so.6: cannot open shared object file: No such file or directory ' in createMVMAndCallParser phase 'Creating local MVM'
解决方法
yum install x11-xserver-utils xhost si:localuser:root
如果没有yum源可以下载xorg-x11-server-utils安装包本地安装https://centos.pkgs.org/7/centos-x86_64/xorg-x11-server-utils-7.7-20.el7.x86_64.rpm.html
安装用于python的MATLAB引擎API
cd /opt/MATLAB/R2018b/extern/engines/python python setup.py install