Linux下使用matlab在后台默默的運行.m文件(無界面形式)


Linux下使用matlab在后台默默的運行.m文件(無界面形式)
本主在Ubuntu18.04LTS上已經安裝了matlab
直接運行Matlab
$ matlab
會啟動 matlab,出現啟動界面
但想要,在后台默默的運行.m文件,如何設置呢?
進入要運行的.m文件所在目錄,執行:
$ matlab -nodesktop -nosplash -r matlabfile(不含.m后綴名)
如:$ matlab -nodesktop -nosplash -r create_training_set_shtech

< M A T L A B (R) >
Copyright 1984-2014 The MathWorks, Inc.
R2014a (8.3.0.532) 64-bit (glnxa64)
February 11, 2014


To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

Warning: Directory already exists.
> In create_training_set_shtech at 23
.......................

另外一種方式:
修改.bashrc文件
$ vim ~/.bashrc
添加如下:

# Add an "mrun" alias for running matlab in the terminal.
alias mrun="matlab -nodesktop -nosplash -logfile `date +%Y_%m_%d-%H_%M_%S`.log -r"
保存后,進入.m文件所在目錄,運行
$ mrun matlabfile(不含.m后綴名)

如:$ mrun create_training_set_shtech

< M A T L A B (R) >
Copyright 1984-2014 The MathWorks, Inc.
R2014a (8.3.0.532) 64-bit (glnxa64)
February 11, 2014


To get started, type one of these: helpwin, helpdesk, or demo.
For product information, visit www.mathworks.com.

Warning: Directory already exists.
> In create_training_set_shtech at 23
.......................


免責聲明!

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



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