MATLAB: [12] MATLAB (正規版) を Linux コマンド ライン (サイレント モード/非グラフィカル モード) にインストールする方法を説明します。

壊れた考え:

(2ヶ月間穴あけされていたことは知っていますが、たくさんの原稿を保存して送信していません)

みなさん、こんにちは。研究所のサーバーにはMATLABの計算資源が用意されていないので(QAQを知らないことが判明)、非グラフィカルMATLABをUbuntuにインストールしています。

他のブロガーのアイデアを参照し、T 大学が提供する本物のリソースを使用することで、途中で多くの落とし穴が踏まれ、最終的に非グラフィカルなインストール プロセスが実現しました。

PS 最近、私はいくつかの技術的な説明ビデオを録画することを学んでいます。それが好きな友達はそれを見ることができます! (Kneel orz)キリト99のパーソナルスペース - キリト99の個人ホームページ - 哔哩哔哩動画

目次

1 環境紹介

2 Linux のインストール MATLAB

2.1 対応する MATLAB バージョンをダウンロードする

2.2 サーバー構成

2.3 MATLAB のインストール

2.4 MATLAB テスト

2.5 環境変数の構成

3 参考ブログ


1 環境紹介

私のサーバー システムは Linux 用の Ubuntu であり、非グラフィカル インターフェイスはありません。

インストールされているバージョンは MATLAB の R2021a Linux バージョンであり、非グラフィカル インターフェイスを使用して起動されます。

以下に、インストールプロセスを詳しく説明します〜

2 Linux のインストール MATLAB

2.1 対応する MATLAB バージョンをダウンロードする

T 大学の学生は、対応する Linux バージョンを学校の Web サイトから直接ダウンロードするか、インターネットで適切なインストール パッケージを見つけることができます。

サーバーにインストールされている場合は、xftp を使用してファイルをcd ~ディレクトリにアップロードできます。

または、U ディスクをローカルで直接使用することもできます。

同時に、network.lic ファイルを同期的にアップロードし、同じディレクトリに配置する必要があります。

T の学生の場合は、ウェブサイトの次の場所で見つけることができます。

 開くと、必要な lic ファイルを含む次のコンテンツが含まれます。

 network.lic もルート ディレクトリにアップロードします。

 同時に、MATLAB インストール シリアル番号を保存する必要があります. T-big は sn.txt ファイルにあり、後で使用されます.

2.2 サーバー構成

SSH を使用してサーバーに接続し (ローカル Linux は無視できます)、コマンド ライン操作を入力します。

ソフトウェア リポジトリを更新します: apt-get update

sudo をインストールします: apt-get install sudo

升级apt-get:sudo apt-get upgrade

このステップは比較的遅いことに注意してください (5 ~ 10 分)。

古いバージョンを保持し、2 を選択:

入力: sudo apt-get install build-essential

入力: sudo apt-get install yum

Yを選択

yum が正常にインストールされているかどうかを確認し、yum と入力します。

以下は成功を示しているようです

解凍ソフトウェアをインストールします: sudo apt install p7zip-full p7zip-rar

Y を入力:

x11 ライブラリをインストールします: sudo apt-get install -y libx11-dev

ライブラリをインストールします: sudo apt-get install xorg-dev

Yを入力してください

ここまでで、サーバー環境の一部の構成が完了し、MATLAB をインストールできるようになりました。

2.3 MATLAB のインストール

ルート ディレクトリを入力してください: cd ~

ファイルを表示: ls

新しい matlab フォルダーを作成します: mkdir matlab

ISO ファイルを matlab ディレクトリに抽出します: 7z x R2021a_Linux.iso -o./matlab

解凍したファイルを表示する

ディレクトリを入力してください: cd matlab/

ファイルを表示: ls

上記の内容が表示されれば、解凍が成功した証です。

ルート ディレクトリに戻ります: cd ~

インストール ディレクトリを作成します: mkdir ~/Matlab_R2021a

インストール構成ファイルを作成します: touch ~/installer_input.txt

構成ファイルを編集します: vim ~/installer_input.txt

i を入力して編集モードに入ります

その中に次のように入力します。

##################################################################
##
## Use this file to specify parameters required by the installer at runtime.
##
## Instructions for using this file.
##
## 1. Create a copy of this template file and fill in the required
##    information.
##
## 2. Uncomment only those lines that start with a single '#'
##    and set the desired values. All allowed values for the
##    parameters are defined in the comments section for each
##    parameter.
##
## 3. Launch the installer from the command line, using the -inputFile option
##    to specify the name of your installer initialization file.
##
##    (Windows) setup.exe -inputFile <file_name>
##    (Linux/macOS) install -inputFile <file_name>
##
##################################################################
##
##
## SPECIFY INSTALLATION FOLDER
## 
## Example:
##        (Windows) destinationFolder=C:\Program Files\MATLAB\RXXXX
##        (Linux) destinationFolder=/usr/local/RXXXX
##        (macOS) destinationFolder=/Applications
##
## Set the desired value for destinationFolder and
## uncomment the line.

destinationFolder=/root/Matlab_R2021a  

##
## SPECIFY FILE INSTALLATION KEY
##
## Example: fileInstallationKey=xxxxx-xxxxx-xxxxx-xxxxx.....
##
## Set the desired value for fileInstallationKey and
## uncomment the line.
##

fileInstallationKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

##
## ACCEPT LICENSE AGREEMENT
##
## You must agree to the license agreement to install MathWorks products.
## The license agreement can be found in the license_agreement.txt file at the
## root level of the installation DVD.
##
## Example: agreeToLicense=yes
##
## Set agreeToLicense value to yes or no and
## uncomment the line.

agreeToLicense=yes

##
## SPECIFY OUTPUT LOG
##
## Specify full path of file into which you want the results of the
## installation to be recorded.
##
## Example:
##            (Windows) outputFile=C:\TEMP\mathworks_<user_name>.log
##            (Linux/macOS) outputFile=/tmp/mathworks_<user_name>.log
##
## Set the desired value for outputFile and
## uncomment the line.

outputFile=/root/matlab_install.log 

##
## Enable Login Named User licensing
##
## Set to Yes to enable use of a Login Named User license for all users of this MATLAB installation
## Users must log in to their MathWorks Account when MATLAB starts.
##
## Example: enableLNU=yes
##
## NOTE: This flag is valid in silent installations only.

# enableLNU=yes

##
## IMPROVE MATLAB
##
## Improve MATLAB by sending user experience information to MathWorks.
## Your participation ensures that you are represented and helps us design
## better products. You can opt in or out of this service either during
## installation or by going to MATLAB preferences.
## https://www.mathworks.com/support/faq/user_experience_information_faq.html

improveMATLAB=yes

########## Begin: Options for Network License Types #########
##
## SPECIFY PATH TO LICENSE FILE (Required for network license types only)
##
## This value is required when installing as a Network End-User
## Example:
##            (Windows) licensePath=C:\TEMP\license.dat
##            (Linux) licensePath=/tmp/license.dat
## Set the desired value for licensePath and
## uncomment the line.

licensePath=/root/network.lic 

########## End: Options for Network License Types #########


################# Begin - Windows Only Options ################
## 
## CHOOSE TO SET FILE ASSOCIATIONS
## 
## Set to true if you want the installer to associate file types used by MathWorks
## products to this version of MATLAB, or false if you do not want the installer to
## associate MathWorks file types with this version of MATLAB.
##
## Default value is true.
##
## Set setFileAssoc value to true or false and
## uncomment the line.

# setFileAssoc=true

##
## CHOOSE TO CREATE WINDOWS DESKTOP SHORTCUT
##
## Set to true if you would like the installer to create a desktop shortcut icon
## when MATLAB is installed or false if you don't want the shortcut created.
##
## Default value is false.
##
## Set desktopShortcut value to true or false and
## uncomment the line.

# desktopShortcut=false

## CHOOSE TO ADD SHORTCUT TO WINDOWS START MENU
##
## Set to true if you would like the installer to create a Start Menu shortcut
## icon when MATLAB is installed or false if you don't want the shortcut created.
##
## Default value is true.
##
## Set startMenuShortcut value to true or false and
## uncomment the line.

# startMenuShortcut=true

## CREATE a MATLAB Startup Accelerator task
##
## The MATLAB Startup Accelerator installer creates a
## system task to preload MATLAB into the system's cache
## for faster startup.
##
## NOTE: By default, a MATLAB Startup Accelerator task will
## automatically be created.
##
## If you want a MATLAB Startup Accelerator task to be created,
## do not edit this section.
##
## Set createAccelTask value to false if you do not want to
## create an Accelerator task and uncomment the line.

# createAccelTask=true

################ End - Windows Only Options ################

## SPECIFY PRODUCTS YOU WANT TO INSTALL
##
## By default, the installer installs all the products and
## documentation for which you are licensed. Products you are not licensed for
## are not installed, even if they are listed here.
##
## Note:
## 1. To automatically install all your licensed products, do not edit
##    any lines in this section.
## 
## 2. To install a specific product or a subset of products for
##    which you are licensed, uncomment the line for the product(s) you want
##    to install.

#product.5G_Toolbox
#product.AUTOSAR_Blockset
#product.Aerospace_Blockset
#product.Aerospace_Toolbox
#product.Antenna_Toolbox
#product.Audio_Toolbox
#product.Automated_Driving_Toolbox
#product.Bioinformatics_Toolbox
#product.Communications_Toolbox
#product.Computer_Vision_Toolbox
#product.Control_System_Toolbox
#product.Curve_Fitting_Toolbox
#product.DDS_Blockset
#product.DO_Qualification_Kit
#product.DSP_System_Toolbox
#product.Data_Acquisition_Toolbox
#product.Database_Toolbox
#product.Datafeed_Toolbox
#product.Deep_Learning_HDL_Toolbox
#product.Deep_Learning_Toolbox
#product.Econometrics_Toolbox
#product.Embedded_Coder
#product.Filter_Design_HDL_Coder
#product.Financial_Instruments_Toolbox
#product.Financial_Toolbox
#product.Fixed-Point_Designer
#product.Fuzzy_Logic_Toolbox
#product.GPU_Coder
#product.Global_Optimization_Toolbox
#product.HDL_Coder
#product.HDL_Verifier
#product.IEC_Certification_Kit
#product.Image_Acquisition_Toolbox
#product.Image_Processing_Toolbox
#product.Instrument_Control_Toolbox
#product.LTE_Toolbox
#product.Lidar_Toolbox
#product.MATLAB
#product.MATLAB_Coder
#product.MATLAB_Compiler
#product.MATLAB_Compiler_SDK
#product.MATLAB_Parallel_Server
#product.MATLAB_Production_Server
#product.MATLAB_Report_Generator
#product.MATLAB_Web_App_Server
#product.Mapping_Toolbox
#product.Mixed-Signal_Blockset
#product.Model_Predictive_Control_Toolbox
#product.Model-Based_Calibration_Toolbox
#product.Motor_Control_Blockset
#product.Navigation_Toolbox
#product.OPC_Toolbox
#product.Optimization_Toolbox
#product.Parallel_Computing_Toolbox
#product.Partial_Differential_Equation_Toolbox
#product.Phased_Array_System_Toolbox
#product.Polyspace_Bug_Finder
#product.Polyspace_Bug_Finder_Server
#product.Polyspace_Code_Prover
#product.Polyspace_Code_Prover_Server
#product.Powertrain_Blockset
#product.Predictive_Maintenance_Toolbox
#product.RF_Blockset
#product.RF_Toolbox
#product.ROS_Toolbox
#product.Radar_Toolbox
#product.Reinforcement_Learning_Toolbox
#product.Risk_Management_Toolbox
#product.Robotics_System_Toolbox
#product.Robust_Control_Toolbox
#product.Satellite_Communications_Toolbox
#product.Sensor_Fusion_and_Tracking_Toolbox
#product.SerDes_Toolbox
#product.Signal_Processing_Toolbox
#product.SimBiology
#product.SimEvents
#product.Simscape
#product.Simscape_Driveline
#product.Simscape_Electrical
#product.Simscape_Fluids
#product.Simscape_Multibody
#product.Simulink
#product.Simulink_3D_Animation
#product.Simulink_Check
#product.Simulink_Code_Inspector
#product.Simulink_Coder
#product.Simulink_Compiler
#product.Simulink_Control_Design
#product.Simulink_Coverage
#product.Simulink_Design_Optimization
#product.Simulink_Design_Verifier
#product.Simulink_Desktop_Real-Time
#product.Simulink_PLC_Coder
#product.Simulink_Real-Time
#product.Simulink_Report_Generator
#product.Simulink_Requirements
#product.Simulink_Test
#product.SoC_Blockset
#product.Spreadsheet_Link
#product.Stateflow
#product.Statistics_and_Machine_Learning_Toolbox
#product.Symbolic_Math_Toolbox
#product.System_Composer
#product.System_Identification_Toolbox
#product.Text_Analytics_Toolbox
#product.UAV_Toolbox
#product.Vehicle_Dynamics_Blockset
#product.Vehicle_Network_Toolbox
#product.Vision_HDL_Toolbox
#product.WLAN_Toolbox
#product.Wavelet_Toolbox
#product.Wireless_HDL_Toolbox

それらの中の一つ

destinationFolder=/root/Matlab_R2021a,

outputFile=/root/matlab_install.log 

licensePath=/root/network.lic 

相対パスではなく絶対パスを記入するように注意する必要があります。

それらの中の一つ

fileInstallationKey=XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

対応するインストール シリアル番号に変更するように注意する必要があります (T の学生は、sn.txt でバージョンに対応するシリアル番号を見つけることができます)~

入力が完了したら、Esc をクリックしてエディターを終了します。

:wq と入力して結果を保存します

インストール構成ファイルの権限を変更します: sudo chmod 444 ~/installer_input.txt

解凍したフォルダーに入ります: cd matlab

ファイルのパーミッションを変更します: chmod a+x -R ./*

~ ディレクトリに戻る: run cd ~

インストール パス フォルダーを入力します: cd Matlab_R2021a

ファイルのパーミッションを変更します: chmod a+x -R ./

~ ディレクトリに戻る: run cd ~

インストールを開始します: sudo matlab/install -inputFile ./installer_input.txt    

このステップにはしばらく時間がかかります (約 20 分)。

別のポートを開いて、ログ ファイルで進行状況を表示できます。

2.4 MATLAB テスト

matlab を実行します: ~/Matlab_R2022a/bin/matlab

インストールが成功したことの証明。

アクティベーションを求められたら、同じディレクトリでアクティベーション ファイルを実行します: ~/Matlab_R2022a/bin/activate_matlab.sh

それでおしまい。

2.5 環境変数の構成

構成の編集: vim ~/.bashrc

最後にテキストを追加します (2 行目は主に、非グラフィカル インターフェイスの自動実行を設定するためのものです)。

export PATH="/root/Matlab_R2021a/bin:$PATH"

エイリアス matlab='/root/Matlab_R2021a/bin/matlab -nodesktop -nodisplay'

Esc を入力して編集モードを終了します

入力: wq、保存して終了

構成の更新: source ~/.bashrc

もう一度テストし、matlab に直接入力します。

インストール成功!

3 参考ブログ

助けてくれた@Δενξέρωに感謝します

グラフィカル インターフェイスなしで matlab をインストールする Linux (純正)_linux matlab アクティベーション_Δεν ξέρω のブログ - CSDN ブログ


これが今号の全内容です. 私の記事が気に入ったら、いいね+ブックマーク+フォローを忘れずに、友達と共有してください~

おすすめ

転載: blog.csdn.net/Alex497259/article/details/129865457