这是由于MCR安装目录和系统默认的不同,首先找到自己电脑安装MCR的目录。
我安装的是MATLAB2017b对应的MCR v93,安装目录是:
/usr/local/MATLAB/MATLAB_Runtime/v93
然后,运行自己的程序run_M_GeneAlgorMain.sh,输入命令:
sudo ./run_M_GeneAlgorMain.sh /usr/local/MATLAB/MATLAB_Runtime/v93
备注:
如果还有问题,请尝试:
用命令$sudo gedit /etc/bash.bashrc 打开bash.bashrc文件,加入路径export PATH=$PATH:/usr/local/MATLAB/MATLAB_Runtime/v93/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v93/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v93/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v93/sys/opengl/lib/glnxa64
然后$sudo gedit /etc/environment 打开environment文件,加入路径:/usr/local/MATLAB/MATLAB_Runtime/v93/runtime/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v93/bin/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v93/sys/os/glnxa64:/usr/local/MATLAB/MATLAB_Runtime/v93/sys/opengl/lib/glnxa64
重启电脑,再次尝试。