Linux安裝MATLAB


Linux下的MATLAB在2013a及以后的版本中,就不再支持32位機了。所以32位Linux系統無法安裝2013a及以后版本。[1]

Linux下安裝MATLAB時,需要先配置好JRE,可以參考:Linux下Java環境配置。

安裝過程如下:

  • 掛載iso鏡像:
    sudo mount <matlab_iso> <mount_dir>
    sudo mount MATLAB2012b.iso /mnt/matlab/
  • 執行安裝程序:
    sudo <mount_dir>/install

  若在安裝過程中出現錯誤,或安裝終止,很可能是因為無法正確找到JRE導致的(Linux下Matlab的圖形界面是依賴jre的,如果jre配置出現問題,無法彈出執行安裝的圖形界面)。可以執行:

sudo <mount_dir>/install -help
Usage: install [-h|help]
                             [-javadir <directory>] | [-root <directory>] |
                             [-test] | [-v|-verbose]

    -h|-help        - Display arguments.
    -test           - Don't actually run the java command (only useful with -v).
    -v|-verbose     - Display settings.
    -javadir <directory>       - Override default java root directory.
    -root <directory>          - Override default DVD root directory.
    -tmpdir <directory>        - Override default directory for temporary files.

    The default settings when no override inputs are supplied are: 
    -root = <directory containing this script>
    -javadir = <root>/sys/java/jre/glnxa64/jre
    -tmpdir = /tmp

  根據上面幫助文件的提示,我們可以知道,在執行install時,需要指定合適的javadir,也就是安裝的JRE的路徑。如:

sudo <mount_dir>/install -javadir=<jre_dir>
  • 根據提示輸入驗證信息,安裝MATLAB
  • 配置desktop文件:
    • 方法一:安裝matlab-support,在Ubuntu下,輸入:
      sudo apt-get install matlab-support
    • 方法二:自己配置Matlab.desktop文件。配置完成后需要將Matlab.desktop文件放到/usr/share/applications/或者 ~/.local/share/applications/目錄下。desktop示例如下:
      [Desktop Entry]
      Version=1.0
      Type=Application
      Terminal=false
      Exec=matlab -desktop
      Name=MATLAB
      Icon=/usr/share/icons/hicolor/48x48/apps/matlab.png
      Categories=Development;Math;Science
      Comment=Scientific computing environment
      StartupNotify=true
      StartupWMClass=com-mathworks-util-PostVMInit

以上配置結束后,就可以正常使用MATLAB了。另外,Linux下的MATLAB還支持命令行中使用,即不顯示MATLAb的圖形界面,這樣就可以很好的結合Shell了。具體可以參考:在命令行下運行MATLAB

參考:

[1] The Mathworks, Inc. MATLAB&Simulink Inatallation Guide R2013a [Z]. 2013


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM